-
Notifications
You must be signed in to change notification settings - Fork 184
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: slide modal out on other side #167
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
To clarify (from @JFrankfurt): I don’t expect the back arrow pointing left < to send the screen that direction |
lgtm |
/** Used when the Dialog is closing. */ | ||
CLOSING = 'closing', | ||
/** Used when the Dialog is paging to another Dialog screen. */ | ||
PAGING = 'paging', |
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.
perhaps a good place to explain the concept of paging and why it's important
src/utils/animations.ts
Outdated
parent.removeChild = function <T extends Node>(child: T) { | ||
if ((child as Node) === current) { | ||
current.classList.add(UNMOUNTING) | ||
const klass = typeof animatingClass === 'string' ? animatingClass : animatingClass() |
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.
not sure i'm following here. why could animating class be a class or string?
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.
I've narrowed the type (to a callback) and tried to explain why this is a callback (and not a string) through comments.
I've included the changes requested in this review.
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR changes the transition behavior for modals.
If there is another dialog taking the place of an active one, the old dialog will slide out to the left (instead of to the right). In code, this is called "PAGING". This avoids risking exposing the screen underneath modals when they are replacing each other, and makes the modals look more sequenced.
It also fixes some issues I discovered while implementing this:
Before
Screen.Recording.2022-08-24.at.9.55.25.AM.mov
After
Screen.Recording.2022-08-24.at.1.23.46.PM.mov