Accordion: Reset toggled-state so we don't keep animating the accordion on remount - #99829
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57c1cd7c4e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-09-03.at.23.40.31.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-09-03.at.23.38.22.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-09-03.at.23.36.52.mov |
|
🚧 lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.70-0 🚀
|
|
🤖 No help site changes are required for this PR, so I did not create a draft docs PR. Why: This change is entirely internal to the Nothing user-facing changed:
What I checkedThe full diff — two files, both in I also searched Help site articles document what a setting does and how to reach it. They do not describe transition animations, so a fix that only changes when an animation replays has no documentation surface. @s77rt — if you disagree and think a specific article needs updating, reply with the article path and I'll open the draft PR. |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.72-0 🚀
|
|
No help site changes are required for this PR, so I did not create a docs PR. This is an internal animation-state fix in the shared Why no docs update applies
Per @s77rt, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR (There is no linked help site PR — no article changes were warranted. If you disagree and want one opened, reply with the article you'd like updated and what it should say.) |
Explanation of Change
When you render an
<According />and you passisToggleTriggered=true(e.g. the toggle for the accordion is pressed) then the height change is animated. However that flag is stuck astrueand if the height changes again then the animation would trigger again.This behaviour in combination with the
react-freezebehaviour that is "hiding" components on page navigation (making their heights 0) causes a bug as when you navigate away (height=0) and navigate back (height=H) causes a height change thus an unexpected animation.In this PR I reset the
isToggleTriggeredflag tofalseonce the animation finishes. That way a remount (or a height change in general) won't cause an animation unless the toggle is pressed again.Fixed Issues
$ #99821
PROPOSAL:
Tests
Screen.Recording.2026-08-29.at.3.15.37.PM.mov
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari