fix(dev-mode): use animationend for modal scroll lock#1220
Open
AdeshDeshmukh wants to merge 3 commits into
Open
fix(dev-mode): use animationend for modal scroll lock#1220AdeshDeshmukh wants to merge 3 commits into
AdeshDeshmukh wants to merge 3 commits into
Conversation
Replace timer-based body scroll locking with an animationend handler tied to the modalShow animation. This removes timing race conditions and keeps modal behavior robust if animation duration changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
javisperez
requested changes
Jun 26, 2026
javisperez
left a comment
Contributor
There was a problem hiding this comment.
Copilot's feedback makes sense, we should handle it.
Prevents the animationend handler from firing on bubbled events from child elements, as suggested by Copilot review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
Author
|
Thank you for the review. I have added the |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
Author
|
Thanks, already pushed the fix. Ready for re-review. |
javisperez
approved these changes
Jun 26, 2026
javisperez
left a comment
Contributor
There was a problem hiding this comment.
LGTM, Thanks for the PR @AdeshDeshmukh !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change fixes the Settings modal open lifecycle by replacing a timer-based body scroll lock with an animation-driven approach.
Problem
The modal previously used a hard-coded
setTimeout(150)inonMountedto addoverflow-hiddentodocument.body. This is brittle and can drift from actual animation timing. Additionally, Vue's scoped styles rewrite@keyframesnames with a hash suffix at build time (e.g.modalShow-xxxx), so a strict equality check against'modalShow'would never match at runtime.Root cause
UI state synchronization depended on elapsed time instead of the real completion event of the
modalShowanimation.Solution
onModalAnimationEnd(event: AnimationEvent)handler@animationend="onModalAnimationEnd".includes('modalShow')to handle Vue's scoped style hashingonMountedisVisiblestateValidation
vite buildpassesAddresses previous review
This is a follow-up to the now-closed PR #1140, addressing @javisperez's feedback:
animationNamecheck to use.includes()instead of!==(handles Vue scoped style hashing)