-
Notifications
You must be signed in to change notification settings - Fork 13.5k
fix(sheet): changing the way sheet footers work during dragging #30433
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
is not duplicated, but the position is changed instead
…ragging to eliminate shaking
@ShaneK Thanks for the heads-up! I had tried a similar approach but ran into issues on larger viewports: Screen.Recording.2025-05-28.at.09.39.43.movWhile investigating the bug, I attempted to address it by setting the modal’s width as the Additionally, we must apply padding to the footer’s last toolbar to account for the bottom safe area. |
Hey, I greatly appreciate that, can't believe I didn't catch it! Let me do some more investigating today and I'll see what I can come up with. Thank you! |
Hey @kumibrr! I've attempted to address this by pinning the constraints of the footer while it's being dragged. Can you please try again and see if you can identify any issues with this approach? I know you just used the test page for the flaw you found before, but if you want to try on a different project, there's a new dev build: |
Issue number: resolves several (listed at the bottom) + internal
What is the current behavior?
Currently, when expand to scroll is disabled in a sheet modal, we duplicate the footer on drag and show a cloned version in the shadow DOM instead of the original. This causes many issues (described in the Other Information section), especially because often times the cloned version of the footer would stick around instead of the original version, which made any event listeners in the footer (and styling) broken by default instead of only while dragging.
What is the new behavior?
We are now following method 2 of the design doc, with minor deviation.
Now we try to eliminate the shaky behavior in the footer by setting the footer to be absolutely positioned on the page and adding padding to the bottom of the modal while dragging is happening to offset the missing footer content. We are additionally performing some extra logic to swap back when the modal is dragged below the height of the footer so that it collapses correctly visually.
Note this is a minor variation in method two from the design doc because I moved the footer to the body instead of to the parent modal. This is because the parent modal will prevent anything not in its ion-page from displaying, but it seems to work fine. As a side-effect of this, I had to add an extra class and support for that class in a few areas so we could identify footers that belonged to modals while they were moving and apply applicable classes.
Additionally with this change I was able to remove all of the extra code in the leave/enter animations because we no longer need to worry about managing a clone of an element there. This allows me to contain all code relating to behavior of the footer to
sheet.ts
.Does this introduce a breaking change?
Other information
This refactor in how the footer combats shakiness should resolve many issues caused by that, including the following:
Current dev build: 8.5.8-dev.11748450896.16232653