-
Notifications
You must be signed in to change notification settings - Fork 810
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
[changed] Replace appElement with getAppElement #360
Conversation
d19808b
to
ce695af
Compare
src/helpers/ariaAppHider.js
Outdated
}); | ||
} else { | ||
appElement.removeAttribute('aria-hidden'); | ||
} | ||
} |
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.
show()
has the same effect if it sets ae.setAttribute('aria-hidden', 'false');
, so hide()
and show()
could betoggle(appElement : DOM, value : bool)
.
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.
Good call :)
This makes getAppElement a required prop as well as makes it a function that will be called expecting a DOMElement. closes #287 This also takes some inspiration from #359 for handling arrays of objects. Upgrade Path: - If you had specified an appElement via `Modal.setAppElement`, then you need to convert that to a getAppElement prop on the modal, this should be a function that returns either a single element or an array of elements. - If you had nothing specified you will need to add the getAppElement element to prevent beakages.
ce695af
to
7940ea0
Compare
This solution elegantly tackles #133 too. |
One thing that I've been thinking about is the change to always require a getAppElement prop. Does defaulting to |
@dminuoso No unfortunately it doesn't make sense. If you do that then all the body ends up hidden from screen readers which definitely makes it non-accessible. We've got that in v1 currently and there are lots of sites out there that get completely hidden from screen readers because of it. |
@claydiffrient are there any plans to back port this to version 1 for issue #133. Or when will V2 have a release soon (beta or otherwise)? Thanks! |
This makes getAppElement a required prop as well as makes
it a function that will be called expecting a DOMElement.
closes #287
This also takes some inspiration from #359 for handling arrays
of objects.
Fixes #[issue number].
Changes proposed:
Upgrade Path (for changed or removed APIs):
Modal.setAppElement
,then you need to convert that to a getAppElement prop on the
modal, this should be a function that returns either a single
element or an array of elements.
element to prevent breakages.
Acceptance Checklist:
CONTRIBUTING.md
.