-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reorder control now proxies accessibility into a seperate element #533
Conversation
4f98207
to
9946411
Compare
76faf8e
to
50ae673
Compare
5c68a31
to
4e398e6
Compare
@@ -5,6 +5,7 @@ | |||
// Created by Kyle Van Essen on 11/14/19. | |||
// | |||
|
|||
import Accessibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, TIL
let recognizer : ItemReordering.GestureRecognizer | ||
private lazy var proxyElement = UIAccessibilityElement(accessibilityContainer: self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, TIL, I had no idea you could do this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, although seems obvious in retrospect.
a4ac909
to
abf5d36
Compare
@@ -66,6 +67,7 @@ public struct ListReorderGesture : Element | |||
isEnabled : Bool = true, | |||
actions : ReorderingActions, | |||
begins: Begins = .onTap, | |||
reorderItemAccessibilityLabel: String? = nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be helpful to add docs for the parameters and indicate to the caller what a recommended localised reordering label might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I noticed below that we're using a string format and plugging in the item name. What do you think about making this an enum instead where the caller can specify whether it's just the item name and they use our localised terminology or whether they themselves want to provide the terminology. For example, in case someone might want to call it Rearrange Foo
instead of Reorder Foo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to push this entirely down to the caller, i think you're right that it needs more customizability but i think that too much magic is overcomplicated here.
} | ||
|
||
@objc private func updateGesturePressDuration() { | ||
self.recognizer.minimumPressDuration = UIAccessibility.isVoiceOverRunning ? 0.0 : self.minimumPressDuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not for this PR, but wondering how the behaviour would be with full keyboard access, Switch Control, and Voice Control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this out using full keyboard access. It kind of works, but I observed that Listable reordering is overall broken for full keyboard access. Then again, even the iOS home screen felt broken for full keyboard access, so there's no prior art to even copy from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldnt expect the gesture recognizer itself to work well with keyboard access. do the accessibility actions work with full keyboard access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add an entry to the changelog?
162cb5a
to
ce3b914
Compare
ce3b914
to
4ae91f1
Compare
* origin/main: Prepare 14.3.0 (#540) Custom Update Animations (#539) Update version to 14.2.0 Prepare 14.2.0 release, which contains a Blueprint update Bumping versions to 14.1.0 (#535) reorder control now proxies accessibility into a seperate element (#533) Prepare 14.0.3 Fix a crash that could occur during cell reuse if a list contained different types of headers. The wrong ObjectIdentifier was being compared and stored. Get a repro for the reordering crash reported in #market-ios chore: Generated documentation now uses a static copyright notice to avoid noisy diffs (#530) Bumping versions to 15.0.2 fix: Fix tap gesture swallowing touches in swipe actions view Bump to 14.0.1 Fix SPM Blueprint dependency Release 14.0.0, update BlueprintUI to 3.0.0 (#525) chore: iOS 15 deployment target bump [UI-5187] (#524) chore: Bump CI to Xcode 15.1. Bump gems. [UI-5186] (#523) fix: don't cancel touches in view for tap gesture recognizer Revert weak change Revert "Revert "Supplementary Tracking Fixes (#433)""
…rovements * origin/main: (33 commits) Prepare 14.3.0 (#540) Custom Update Animations (#539) Update version to 14.2.0 Prepare 14.2.0 release, which contains a Blueprint update Bumping versions to 14.1.0 (#535) reorder control now proxies accessibility into a seperate element (#533) Prepare 14.0.3 Fix a crash that could occur during cell reuse if a list contained different types of headers. The wrong ObjectIdentifier was being compared and stored. Get a repro for the reordering crash reported in #market-ios chore: Generated documentation now uses a static copyright notice to avoid noisy diffs (#530) Bumping versions to 15.0.2 fix: Fix tap gesture swallowing touches in swipe actions view Bump to 14.0.1 Fix SPM Blueprint dependency Release 14.0.0, update BlueprintUI to 3.0.0 (#525) chore: iOS 15 deployment target bump [UI-5187] (#524) chore: Bump CI to Xcode 15.1. Bump gems. [UI-5186] (#523) fix: don't cancel touches in view for tap gesture recognizer fix: don't cancel touches in view for tap gesture recognizer Revert weak change ...
This allows the gesture recognizer to be applied to a view without overriding its accessibility.
Useful in situations where you'd like the gesture to apply to the entire cell for example.
Checklist
Please do the following before merging:
Main
section.