-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(modal): backdrop animation when backdropBreakpoint is 1 #25430
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
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.
This causes the animation to flicker with an off-center backdrop breakpoint, e.g. a modal with this config: { backdropBreakpoint: 0.3, initialBreakpoint: 0.3, breakpoints: [0.3, 0.5, 0.7, 1] } (You can see this with the "Backdrop breakpoint is off-center" button in the sheet test -- screencast.) If I log the slope for that config, it's about 1.4 without the Math.min applied.
|
Fixing this should be a matter of returning When const slope = 1 / (1 - backdropBreakpoint);This results in the bug reported in the issue thread. |
|
Alternatively, I think what Sean was trying to do was this: const slope = 1 / (Math.min(1, 1 - backdropBreakpoint));Might be worth trying that too. |
|
Updated to check if the I did experiment with the New dev-build posted: |
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.
Looks great to me now 👍
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docsrepo, in a separate PR. See the contributing guide for details.npm run build) was run locally and any changes were pushednpm run lint) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
When the
backdropBreakpointon a sheet modal is1, the calculation for the opacity keyframe animation will return an invalid result (NaN). This is due to the calculation evaluating tox * Infinity + -Infinity.Issue URL: #25402
What is the new behavior?
0when the backdrop breakpoint is 1 (since the backdrop is invisible)backdropBreakpointof1on a sheet modal and performing a dismiss swipe gestureDoes this introduce a breaking change?
Other information
Dev-build:
6.1.10-dev.11654886605.11e4eab6🟨