docs: Update Modal.tsx description to note a11y limitations #4280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the RNP modal is nearly totally non-accessible, because it renders outside the normal element hierarchy, and so a screen-reader user, navigating by the most common methods (next-element swipe or next-heading), will continue on the page without even being aware the modal has opened. The intended behavior for modals (as seen with the React Native modal, or web modals), is for focus to shift to the modal as soon as the modal opens. With the RNP modal, focus remains unaffected, leaving the screen-reader user unaware a modal has even opened, and unable to reach it via the most common navigation actions (next-element or next-heading).
This adds a note to the docs making end-users aware of this limitation. This is vitally important, as currently any app implementing the RNP modal becomes an inaccessible app. (This was responsible for 8 of the top issues in our app flagged during an external accessibility audit, and resulted in us having to pull out all the RNP modals and replace them with either bottomsheets or generic RN modals.) End users need to be aware of this limitation before they choose to use this component.
Related issue
This is related to #3912, but does not address it; it just makes end-users aware of the issue.
Test plan
Check that text is clear and correctly formatted.