Replies: 1 comment 3 replies
-
While I generally agree with this, it’d definitely be useful to know if any users ran into any edge cases here. If removing this helps accessibility but totally breaks someone’s app (without any way to fix it with react-modal v4), that’d be a shame! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, thanks for all the support through the years...reporting and answering issues, or submitting PRs. You guys are great.
I try my best to find time to help improve this package, but I can't do it alone...
I have a dream to finally release version 4 for react-modal, but I didn't have a good goal to invest time to push it forward.
The goals for v4:
It would be better to have a more stable releases without breaking accessibility.
The default is to apply the
aria-hidden
attribute to thedocument.body
. But this hides everythingThis will require the user to explicitly define the element(s), using its id or class or element, using
Modal.setAppElement()
.To normalize the API,
Modal.setAppElement()
andappElement={}
must use arrays to keep the API simple.ariaHideApp
This is an unnecessary flag, this behavior can be archived by passing
[]
toModal.setAppElement()
andappElement={}
. But it shouldn't be recommended.shouldFocusAfterRender={boolean}
The modal must always gain focus and trap (correctly).
shouldReturnFocusAfterClose={boolean}
withreturnFocusTo={Element}
This can be an element that will gain focus after the modal is closed.
The default behavior is to return the focus to the element on
document.activeElement
before open the modal, but...in some browsers, this behavior is broken so we can't always trust it. So, the user can pass to this attribute an element that must receive the focus later.This package manages a lot of state (like open instances, styles classes added to external elements, focus system...)
With this goals in mind, the API will be less flexible to disable the features related to accessibility, which should not be a problem, but maybe some users will not see this a gain...So, I decided to start a discussion before moving forward with this...
I'll let this open until the end of Jun, and if the feedback is positive, I'll set up the project so everybody can participate!
Thanks,
Dias
Beta Was this translation helpful? Give feedback.
All reactions