-
Notifications
You must be signed in to change notification settings - Fork 352
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
fix(modal): rename reactRoot to srHide and add to ts file #1098
Conversation
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.
Will About Modal have the same issues?
/** React application root element */ | ||
reactRoot: PropTypes.instanceOf(safeHTMLElement).isRequired | ||
/** The parent element container to hide from screen-reader applications when the modal is open */ | ||
srHide: PropTypes.instanceOf(safeHTMLElement).isRequired |
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.
Can we please remove the isRequired?
@@ -14,7 +14,7 @@ class SimpleModal extends React.Component { | |||
|
|||
render() { | |||
const { isModalOpen } = this.state; | |||
const reactRoot = typeof document !== 'undefined' ? document.querySelector('#___gatsby') : ''; | |||
const srHide = typeof document !== 'undefined' ? document.querySelector('#___gatsby') : ''; |
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.
As an app developer, it's not clear what I should use in place of the '#___gatsby' selector. It would be helpful to add a comment in this example describing what I should use instead.
@@ -9,6 +9,7 @@ export interface ModalProps extends HTMLProps<HTMLDivElement> { | |||
isOpen?: boolean; | |||
onClose?: Function; | |||
title: string; | |||
srHide: Element; |
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.
Can we please make srHide optional?
Not sure why this worked during my test if it's not optional? That is, I didn't provide an srHide property.
PatternFly-React preview: https://1098-pr-patternfly-react-patternfly.surge.sh |
Pull Request Test Coverage Report for Build 3679
💛 - Coveralls |
@tlabaj from what i can see About Modal does not apply aria-hidden (yet) |
No description provided.