-
Notifications
You must be signed in to change notification settings - Fork 186
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
fix: Disable snippet previews while snippet panel is closing #371
Conversation
🦋 Changeset detectedLatest commit: 14d14e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Nice one!
Disable snippet previews while the snippets panel is closing. | ||
|
||
Previously, snippet previews could be triggered while the snippet panel was closing, causing preview frames to enter an invalid state. | ||
Previewing a snippet will now only work when the snippet panel is open. |
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.
This feels a bit too much like implementation detail to me. I'd just mention the bug and say it's fixed.
Disable snippet previews while the snippets panel is closing. | |
Previously, snippet previews could be triggered while the snippet panel was closing, causing preview frames to enter an invalid state. | |
Previewing a snippet will now only work when the snippet panel is open. | |
Fixes a bug that was causing duplicate snippet previews and broken preview updates when a snippet was clicked and the mouse was moved while the snippets panel was closing |
It's a bit of a long sentence, but I think it gets the point across.
isOpen && !isHighlighted | ||
? () => { | ||
setHighlightedIndex(index); | ||
} | ||
: undefined | ||
} | ||
onMouseDown={() => closeHandler(filteredSnippets[index])} | ||
onMouseDown={() => { | ||
closeHandler(filteredSnippets[index]); | ||
}} |
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.
Could make this diff smaller by removing the curly braces from the functions. Github wouldn't let me suggest a change :(
Resolves #368
This issue occurs when the user moves their cursor over a snippet in the snippet panel, while the panel is closing.
This triggers the frames to enter a mode for previewing snippets, which is only ended when the snippets panel is initially closed.
This change prevents snippets from being previewed after the panel begins to close.