-
Notifications
You must be signed in to change notification settings - Fork 102
Introduce the basic support of accessibility in the web target #2188
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/webCommonW3C/kotlin/androidx/compose/ui/window/ComposeWindow.web.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/webCommonW3C/kotlin/androidx/compose/ui/window/ComposeWindow.web.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/webCommonW3C/kotlin/androidx/compose/ui/window/ComposeWindow.web.kt
Outdated
Show resolved
Hide resolved
| sealed class A11YConfiguration { | ||
| internal object Disabled : A11YConfiguration() | ||
| internal object Enabled : A11YConfiguration() | ||
|
|
||
| internal fun isA11YEnabled(): Boolean { | ||
| return this == Enabled | ||
| } | ||
| } |
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.
why do we design it as a sealed class instead of a simple enum?
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 changed the API in the latest commit.
Now there is this class:
class ComposeViewportConfiguration internal constructor() {
internal var isA11YEnabled: Boolean = true
fun disableA11Y() {
isA11YEnabled = false
}
}The fun ComposeViewport function now has a configure lambda where a user can change the configuration.
iOS has a similar config and a lambda in the entry point. So I think this would keep simple and allow for more features if needed.
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.
Changed it again according to our discussion:
class ComposeViewportConfiguration internal constructor() {
@ExperimentalComposeUiApi
var isA11YEnabled: Boolean = true
}
...ebCommonW3C/kotlin/androidx/compose/ui/platform/accessibility/ComposeWebSemanticsListener.kt
Show resolved
Hide resolved
...ebCommonW3C/kotlin/androidx/compose/ui/platform/accessibility/ComposeWebSemanticsListener.kt
Outdated
Show resolved
Hide resolved
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.
An impressive piece of work, thank you for taking care of this!
| const val Tab = 4 | ||
| const val Image = 5 | ||
| const val DropdownList = 6 | ||
| const val ValuePicker = Unknown // TODO: Any web alternative? |
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 ComboBox?
| const val Image = 5 | ||
| const val DropdownList = 6 | ||
| const val ValuePicker = Unknown // TODO: Any web alternative? | ||
| const val Carousel = Unknown // TODO: Any web alternative? |
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.
Most similar to TabList (kinda a tabbed role)
Role.Carousel KDoc:
Associated semantics properties for Pager accessibility actions: SemanticsActions.PageUp,SemanticsActions.PageDown,SemanticsActions.PageLeft, SemanticsActions.PageRight
TabList Description:
Keyboard interactions
For the tab list:
Tab
When focus moves into the tab list, places focus on the active tab element.When the tab list contains the focus, moves focus to the next element in the page tab sequence outside the >tablist, which is the tabpanel unless the first element containing meaningful content inside the tabpanel is >focusable.
When focus is on a tab element in a horizontal tab list:
Left Arrow
moves focus to the previous tab. If focus is on the first tab, moves focus to the last tab. Optionally, activates >the newly focused tabRight Arrow
Moves focus to the next tab. If focus is on the last tab element, moves focus to the first tab. Optionally, >activates the newly focused tabWhen focus is on a tab element in a vertical tab list:
Up Arrow
moves focus to the previous tab. If focus is on the first tab, moves focus to the last tab. Optionally, activates >the newly focused tab
Down Arrow
Moves focus to the next tab. If focus is on the last tab element, moves focus to the first tab. Optionally, >activates the newly focused tabIf the tab list is horizontal, it does not listen for Down Arrow or Up Arrow so those keys can provide their >normal browser scrolling functions even when focus is inside the tab list.
When focus is on a tab in a tablist with either horizontal or vertical orientation:
Introduce the basic support of accessibility in the web target
Fixes https://youtrack.jetbrains.com/issue/CMP-7675
Testing
Release Notes
Highlights - Web