fix(palette): cancel hover timeout on click to prevent double-click needed to open palette#7496
Open
KeerthiKumarR wants to merge 1 commit into
Open
Conversation
…eeded to open palette
Contributor
|
🧪 Jest Test Results ✅ All Jest tests passed! This PR is ready to merge. Coverage: Statements: 48.3% | Branches: 39.92% | Functions: 53.01% | Lines: 48.7% |
Contributor
Author
|
@walterbender @Ashutoshx7 Please have a look when you have time! |
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.
Fixes: #7495
Problem
When a palette (e.g. Meter) is open and the user clicks a different palette
(e.g. Ornament), the new palette does not open on the first click — a second
click is required.
Root Cause
_loadPaletteButtonHandlersets a 400ms hover timeout via_menuOpenTimeouton
onmouseoverthat callsshowPalette. When the user moves the mouse fromone palette row to another and clicks, the hover timeout from the mouseover
fires and calls
_hideMenus, racing with the click handler which also callsshowPalette. The net result is the first click only closes the open palettewithout opening the new one.
The
onmouseouthandler already calls_clearPendingMenuOpen()to cancelthe timeout, but
onclickdid not — leaving the race condition open.PR category
Fix
Add
this._clearPendingMenuOpen()at the top of theonclickelse-branch in_loadPaletteButtonHandler, consistent with howonmouseoutalready handles it.Files Changed
js/palette.js— one line added in_loadPaletteButtonHandler