-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add modal with web support and animations #1698
Conversation
Improvement would be listening to animationEnding instead of the
Also the internalVisible could be removed in favor of css animations instead of transition. Is it possible to add a css animation with React Native Web styles? |
I'm rewriting this partly to support multiple modals on top of each other while keeping focus at the current modal :) |
There's already another PR for modals that you should coordinate efforts with. I'd rather not use class components or Animated in the implementation. But that PR is more comprehensive. #1646 @imnotjames |
👋 Hi there! Do check out the PR I'd opened a while back. It might be able to handle many of the use cases a modal should, along with a number of accessibility efforts baked in. @necolas Oh, wonderful. You've moved away from using class components. At the time when I originally wrote the PR everything was using class components - so I kept it uniform with all the rest. I'll quickly update my PR to be uniform with the rest of the project! |
Ah that looks more complete indeed. I will post my final code here anyway since maybe there are things we could pick from this PR (when I update the code) The animations would be nice to be done in CSS instead of Animated since Animated can be quite laggy with animating modals. E.g.
|
I think the issue with the CSS animations was that I was having trouble setting up a callback to fire after they'd completed. Is that possible with CSS animations now? |
I did have the same problem, I just fixed it but it would be even cleaner if we could use the onTransitionEnd provided by React. I now listen to 'transitionend' events. |
When a modal closes it also focused back on the previous modal. |
[ x ] Hides app content from screen-readers when active. I think the other PR is more completed now (#1646). And is nicely done with animationEnd, looking good @imnotjames 👍 |
Thanks for putting this together and helping with the other PR @RichardLindhout! Going to close this now and direct any further suggestions to the other PR under review |
Fixes: #1020