[Mobile]: Improve screen reader support on BottomSheet's cells.#15213
[Mobile]: Improve screen reader support on BottomSheet's cells.#15213
Conversation
I think in this case we can really benefit from _x( "%1$s. %2$s", "
I agree, I think this case deserves a more generic handling. I'd say let's just concatenate label and value at base level otherwise it will generate code duplication and will be more bug prone. |
|
@pinarol - Thanks for the review! Please take a look anytime you get the chance :) |
pinarol
left a comment
There was a problem hiding this comment.
Looks and works great! 🎉
Tested with WPAndroid and WPiOS apps on real devices
|
Thank you! |
Ref: wordpress-mobile/gutenberg-mobile#935
This PR focuses on the cells of the bottom sheets, providing better labeling, hints and action handling.
For both the Cells with value and SwtchCells, the manual handling of the labels is not optimal, but required if we want to properly localize the whole sentence.
I believe that for these cases we can make an exception, and generically concatenate
labelandvalueas the accessibility label for cells with value.Same for switches, we can generically concatenate the localized switch state with
_x(), indicating the context of theOn,Offstrings.This will save us from possible mistakes in the future, and will help with an easier accessibility maintenance.
I left this PR implementing the first case to show the point. But I'd happily edit it to automatically handle accessibility labels in BottomSheet cells. See the changes on
image/edit.native.jsandlink/modal.native.js.EDIT: Made changes to handle accessibility labels internally.
To test:
Emptywhen correspond.Emptywhen correspond.