-
Notifications
You must be signed in to change notification settings - Fork 79
Add support for dialogs #549
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
base: main
Are you sure you want to change the base?
Conversation
|
@mwcampbell I've got Narrator to work. Ready for another round of review. |
|
Tested with JAWS, Narrator, and NVDA. The Windows implementation looks good. On the latest macOS, the dialog is still treated as just a group. I'll spend a little time looking at this now. |
|
WebKit seem to just use the role description to indicate dialogs. |
Chromium also does the same, Chromium seems to use "dialog" and WebKit seems to use "web dialog". Firefox doesn't currently expose dialogs properly for voice over so they're just groups. Note these strings should be localised. "alert dialog" and "web alert dialog" are used for Role::AlertDialog fwiw |
|
Thanks @lukewarlow for the confirmation. String localization is an unsolved question for us. Anyway using role description doesn't seem to achieve the same behavior as native macOS apps. It would be awesome if someone could try building a test app with a dialog using SwiftUI for instance and report what the Accessibility Inspector has to say. I think we're all missing something here. |
|
With a StoryBoard AppKit UI that runs @IBAction func showDialog(_ sender: Any) {
let alert = NSAlert()
alert.messageText = "Delete File?"
alert.informativeText = "This action cannot be undone."
alert.alertStyle = .warning
alert.addButton(withTitle: "Delete")
alert.addButton(withTitle: "Cancel")
let response = alert.runModal()
print("Response: \(response)")
}When I inspect the dialog that shows I get, Role AXWindow and Subrole AXDialog. If I run it via .beginSheetModal which seems to be the modern way I get a role of AXSheet and no subrole. MacOS doesn't seem to have a "dialog" element the same way that the web platform does. Worth noting that WebKit and Chromium for role="dialog" / Firefox uses Role AXGroup and then Subrole AXUnknown and seemingly no role description, so it just announces group. |
Implements dialogs and alert dialogs as well as the "modal" state.
This works fine with NVDA, the Narrator and Orca. JAWS properly report dialogs but for some reason the title in the example below is still announced after the dialog is closed. VoiceOver reports dialogs as groups. I can't make the example run on my Android phone right now.
platforms/winit/examples/dialog.rs