-
Notifications
You must be signed in to change notification settings - Fork 808
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
[added] shouldCloseOnEsc prop #487
[added] shouldCloseOnEsc prop #487
Conversation
90e0065
to
f94481c
Compare
1 similar comment
1 similar comment
@spen Can you update the commit message to include |
@diasbruno sure thing! I'll squish it all done while I'm at it. |
bb59386
to
2a4f9fc
Compare
1 similar comment
2a4f9fc
to
7b82fa6
Compare
Squished & amended :) P.S. Sorry for all the coveralls triggers! 😆 |
@spen It looks good. Tomorrow, I'll finish to review this PR. |
@spen Can you rebase your branch, please? I'll get this merged. Perhaps, we need to update the documentation to warn about the accessibility issue if using this flag. |
@diasbruno That makes a lot of sense, I'll add & rebase :) |
Sorry for the hiatus here @diasbruno & thanks for your patience - I've had lots of other priorities lately! |
No problem. |
7b82fa6
to
06ff57d
Compare
Thanks Dias, /*
Boolean indicating if pressing the esc key should close the modal
Note: By disabling the esc key from closing the modal you may introduce an accessibility issue.
*/
shouldCloseOnEsc={true} Please do let me know if you'd like any changes to the wording or for extra doc coverage elsewhere in the project :) |
Look good. I'll get this merged today. |
@spen A few things before merge:
|
44bc576
to
9ccab60
Compare
src/components/ModalPortal.js
Outdated
@@ -18,6 +18,7 @@ const ESC_KEY = 27; | |||
|
|||
export default class ModalPortal extends Component { | |||
static defaultProps = { | |||
shouldCloseOnEsc: true, |
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.
You can move this prop to Modal.js
and modal will pass to the portal.
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.
Well spotted!
I've moved the default prop value :)
shouldCloseOnEsc: Add prop and logical check to keyHandler shouldCloseOnEsc: Add to docs/README.md
9ccab60
to
6991467
Compare
1 similar comment
Thanks heaps for helping with these finishing touches Bruno :) |
Released |
Cheers Bruno! :) |
Thanks for fixing this! Just started using this and it works. |
Fixes #481.
Changes proposed:
shouldCloseOnEsc
Acceptance Checklist:
CONTRIBUTING.md
.