-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix double tap in a11y mode moves thumb to the center of the Slider
#157601
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
Conversation
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
77d470e to
e8b5be8
Compare
e8b5be8 to
c04e538
Compare
| await expectLater(tester, meetsGuideline(labeledTapTargetGuideline)); | ||
| // Skip the Slider use case, it uses tap action without label on purpose. | ||
| // see ttps://github.com/flutter/flutter/pull/157601. | ||
| if (useCase.name != 'Slider') { |
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.
Not very sure whether we can modify the test like this. @hannah-hyj and @chunhtai are OOO, we can double check with them next week:)
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 also not sure but this guideline test doesn't really work for Slider. When testing the Android components Slider, it is tappable in a11y mode without changing the Slider value and shows overlay.
My fix overrides Semantic with action tap to show overlay but action tap require semantics label but an existing Slider test prevents this. So i decided to skip the a11y test itself.
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 see. If the current behavior is intended, I think we can create an issue for the guideline and add a TODO here:)
CC: @chunhtai
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.
This doesn't look right, the slider use case does assign a label to the slider, it should not have failed the test. Can you dump the semantics tree when run the a11y_assessment app? i suspect something is forming a node unexpectedly
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.
@chunhtai
I've reverted the a11y_assessment. changes to show the error logs in the CI to 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.
So I try to understand the issue. It looks like ios that it will issue regular tap if there isn't a semantics tap. the regular tap taps the center of the slider causes it to change the value to the middle.
The code here is a workaround so that the ios thinks there is a semantics tap so that it won't issue regular tap. This seems to me it is something that we should fix in iOS embedding. More specifically here should return YES if this is a slider
https://github.com/flutter/engine/blob/e553cd61645fc9bb21e62055e75ccddb09b596eb/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm#L695
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.
Tagging @bleroux who can help fix this in the engine side.
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.
If we agree the fix should be on the iOS side, I think we should close this pr
c04e538 to
96f01cc
Compare
|
(Triage): Flyby comment, there are a bunch of failing checks. |
) ## Description iOS fix [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter/flutter#156427) per instruction from flutter/flutter#157601 (comment) I don't have a physical iOS device to double check, but using the iOS Simulator and accessibility tools, the behavior seems ok. Without this PR, the slider thumb goes to the center when clicking 'Activate', with this PR it does not : https://github.com/user-attachments/assets/697acadd-7fb1-40a5-ba5a-b549cac381a1 ## Related Issue iOS fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter/flutter#156427) ## Tests Adds 1 test.
## Description Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter/flutter#156427). Similar to [the iOS engine fix](#56427). Slider widget doesn't define a Semantics.onTap handler, so a double-click while in accessibility mode defaults to a regular tap down event to which _RenderSlider reacts by changing the slider value. Adding a onTap callback on the framework side was tried in flutter/flutter#157601 but it breaks one accessibility guideline test, see flutter/flutter#157601 (comment)). See flutter/flutter#157601 (comment) for the reasoning to make the change at the engine level. ## Related Issue Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter/flutter#156427). ## Tests Adds 1 test.
…tter/engine#56427) ## Description iOS fix [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter#156427) per instruction from flutter#157601 (comment) I don't have a physical iOS device to double check, but using the iOS Simulator and accessibility tools, the behavior seems ok. Without this PR, the slider thumb goes to the center when clicking 'Activate', with this PR it does not : https://github.com/user-attachments/assets/697acadd-7fb1-40a5-ba5a-b549cac381a1 ## Related Issue iOS fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter#156427) ## Tests Adds 1 test.
…6452) ## Description Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter#156427). Similar to [the iOS engine fix](flutter/engine#56427). Slider widget doesn't define a Semantics.onTap handler, so a double-click while in accessibility mode defaults to a regular tap down event to which _RenderSlider reacts by changing the slider value. Adding a onTap callback on the framework side was tried in flutter#157601 but it breaks one accessibility guideline test, see flutter#157601 (comment)). See flutter#157601 (comment) for the reasoning to make the change at the engine level. ## Related Issue Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](flutter#156427). ## Tests Adds 1 test.
Fixes [A11y] Double Tap brings the
Sliderthumb to the center of the widget.Description
When double tapping in talkback or voice over mode on mobile platform, the
Sliderthumb moves to the center of the widget and changes the Slider value unexpectedly. When the user expects to swipe or down to adjust theSliderthumb. When tapping theSlidershould show overlay for 500 milliseconds to bring attention instead of the moving the thumb to the center of the widget.Code sample
expand to view the code sample
Before
The demo uses swipe up and down gesture to adjust the
Slider. However, when double tapped the thumb unexpectedly moves to the center of the widget.VID_20241025180329.mp4
After
The demo uses swipe up and down gesture to adjust the
Slider. When double tapped the overlay is shown briefly.VID_20241025180241.mp4
Android Components
VID_20241025180439.mp4
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.