-
Notifications
You must be signed in to change notification settings - Fork 811
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
How to perform action on modal open? #50
Comments
set it 'true' |
@yhjor1212 what? set what to true? |
What did you mean by "delay"? From what moment it is delayed? |
Thanks for putting this React Modal together. Really nice. I think this and the issue on focus can be handled by having an onAfterOpen callback passed in as a prop. This way, after the modal is open, we can perform an action on open which includes the ability to set the focus. My feeling is that it may be beneficial to remove the auto-focus since it's not necessary in a lot of cases and in cases where you want it, you can easily add focus through the onAfterOpen callback. In any case, if you do keep it, just a reminder to make sure the autofocus happens before the onAfterOpen callback or else any focus set in the callback would be lost. Would also solve the following issue: #51 |
Closing because #154 was released. |
It seems that with the
isOpen
api, neithercomponentDidMount
norcomponentDidUpdate
actually guarantee the modal is open, even when making sure props.isOpen is set. I'm not sure what causes the delay, but if I want to do something like focus an input on modal open, I can't do it because the modal isn't visible yet.The text was updated successfully, but these errors were encountered: