-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(accordion): include margins during expand animation #26390
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
liamdebeasi
left a comment
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.
Thanks for the PR! It looks like this breaks some tests. Can you look into fixing the code such that the tests pass? Let me know if you have questions about any of the tests.
|
It looks like I just had a duplicate id in the test. Should be fixed now |
|
It seems like the failures are not related to this change? |
|
Hmm yeah looks like the test runner is having issues: I'll rerun the failing tests and see if that fixes it. |
liamdebeasi
left a comment
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 am still able to reproduce the issue when checking out your code:
Screen.Recording.2022-12-09.at.2.55.44.PM.mov
tested on Chrome 107 on macOS 12.6
|
Ah, good ol' browser discrepancies. I'm running linux and unfortunately do not have access to a macOS device. I tested Chrome Version 107.0.5304.110 (Official Build) (64-bit) as well as Firefox 107.0 (64-bit) and the animation appears smooth. Are you perhaps able to confirm that the issue is fixed on a non-macOS device to determine if the issue is only present there? Edit: here's a video capture from my machine: 2022-12-09.15-38-04.mp4 |
|
I can confirm that the changes work well in a Chromium browser on Windows 10: accordion-windows.mp4However, the issue also persists on Chrome for Android: accordion-android.mp4 |
|
Hey @kemp, Are you still interested in working on a fix for this? In terms of remaining work, we'll need to find a solution that works cross platform. |
|
@liamdebeasi yes I'm still looking into a solution when I have time. Apologies for the delay |
|
No problem at all. Let me know if I can help! |
|
@liamdebeasi your comment did remind me though to look at it again, lol Could you actually try it again on your devices? I was able to test on more devices, including the ones you commented previously, and it all appears to be working for me. Perhaps there was a stale cache? |
|
The fix seems to work on iOS 16. @amandaejohnston @sean-perkins Could you test on your devices too? (desktop and mobile) |
|
Looks good on my end 👍 Tested on Windows Chrome and Firefox, plus Android Chrome. Thank you for fixing this! |
liamdebeasi
left a comment
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 previously tested this, and it seems to work. @sean-perkins Can you give this a test?
sean-perkins
left a comment
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.
Tested on:
- Chrome: Version 110.0.5481.177 (Official Build) (arm64)
- Mobile Safari (iOS 16.0.1)
Animation/margins looks good 👍
|
Thanks everyone. 💯 |
Closes #26381
It appears that the issue had nothing to do with the calculation of the height in the script, but instead was due to collapsing margins. Adding
overflow: autoprevents the margins from collapsing.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?
The animation for accordions is jerky when the root content element has a margin.
Issue URL: #26381
What is the new behavior?
Does this introduce a breaking change?
Other information
N/A