-
Notifications
You must be signed in to change notification settings - Fork 98
Support focus change with VoiceOver #2217
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
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/platform/Accessibility.uikit.kt
Show resolved
Hide resolved
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/platform/Accessibility.uikit.kt
Show resolved
Hide resolved
|
||
if (forceFocusedElementKey != focusedElementKey) { | ||
forceFocusedElementKey = focusedElementKey | ||
focusedElementKey?.let { |
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 there is no focused elemet (focusedElementKey == null
) don't we want to set the focuseMode
to None
here?
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.
No, we should keep the old value. The reason is that Compose Ficus and Accessibility focus are work in parallel.
forceFocusedElementKey
represent focused element of the Compose, but focuseMode
represent the focus of Accessibility (at least it tries).
The logic is the following: when Compose focuses some node, we have to move Accessibility focus to this place. If compose releases focus, we don't need to do anything and keep focus as it was before.
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.
ok, thanks for the explanation!
Change the accessibility focus to the most recently focused element.
Due to the complexity of implementation, it does not refocus on the same accessibility element that was already in focus. (Same behavior present on native iOS).
Fixes https://youtrack.jetbrains.com/issue/CMP-8272/Focus-change-with-VoiceOver-on-iOS-not-working
Release Notes
Fixes - iOS