-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Mobile: Accessibility: Improve dialog accessibility #11395
Mobile: Accessibility: Improve dialog accessibility #11395
Conversation
…enus Previously, a library that did not properly manage accessibility focus was used. This commit updates the existing web dialog logic (which uses a React Native `Modal`) to also provide long press and note re-order menus.
}]); | ||
}); | ||
}, | ||
prompt: (title: string, message: string, buttons: PromptButton[] = defaultButtons, options?: PromptOptions) => { |
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.
Note: This function was originally in DialogManager.tsx
.
// Note: Alert.alert provides a more native style on iOS. | ||
Alert.alert(title, message, buttons, options); |
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.
For now, this continues to use the React Native Alert.alert
when .prompt
is called on Android and iOS. If desired, this could be adjusted to always use the custom alert dialogs.
That looks good, thank you for improving this. The dialogs overall look better and I don't think it's too much of an issue the message box background on dark theme |
Summary
This pull request improves the accessibility of certain dialog components by replacing
react-native-dialogbox
with a custom dialog component.react-native-dialogbox
has the following accessibility issues:This pull request fixes most of the above issues.
Related to #10795.
Implementation details
react-native-dialogbox
is replaced by extending the existing custom dialog logic used for the web client. In particular,ScrollView
to allow all items to be accessed on small screens.Screenshots
Web
Sort dialog: Larger screen/light mode
Sort dialog: Small screen/light mode
The following before/after comparison shows the "sort notes by" dialog on web at 320x256 screen resolution (as required by WCAG 2.2/SC 1.4.10):
Before, some items were clipped offscreen and could not be scrolled to. With this change, it's possible to scroll the dialog vertically to access the items.
Sort dialog: Small screen/dark mode
As above, this screenshot is a before/after comparison, but in dark mode. The updated dialog uses Joplin's theme colors, while the original does not:
Alert dialog
On web, alert dialogs and menu dialogs now share code. The alert dialog style has changed. In particular, it uses
theme.backgroundColor1
rather than the default color for elevated surfaces:This more closely matches the style of other dialogs (e.g. the plugin info dialog).
This does, however, make the dialog less visible in dark mode:
Screen recording
iOS
The attached screen recording demonstrates:
out.webm
Android
Portrait:
The attached video demonstrates:
android-1.webm
Landscape mode:
The attached recording demonstrates:
untitled.webm