fix(editor): suppress hover UI and interactions during cursor auto-hide#116
Merged
fix(editor): suppress hover UI and interactions during cursor auto-hide#116
Conversation
- Add pointer-events:none to prevent new hover triggers while hidden - Add display:none for .bn-resize-handle and .bn-side-menu to dismiss already-visible hover UI (React hovered state persists after hide) - Add mousedown/mouseup guard to suspend timer during text selection - Add window blur listener to reset mouseHeld when released outside - Keep pointer-events:auto for user-opened overlays (dialogs, menus) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The mutable cursorAutoHideConfig was only populated when the settings dialog was opened (useCursorAutoHide hook). Add store initialization to useCursorAutoHideEffect so the feature activates immediately. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pointer-events:none blocks wheel scroll hit-testing. Add a wheel event listener on document that restores the cursor on the first scroll tick, allowing subsequent ticks to scroll normally. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Cursor auto-hide previously only set
cursor: none, which hid the pointer visually but still allowed hover events to fire. This caused image resize handles, side menus, and other hover-triggered UI to appear or persist during inactivity.Changes
3-layer cursor auto-hide defense
cursor: none— visual hide of the mouse pointerpointer-events: none— prevents new hover events on child elements;document-levelmousemovestill fires for cursor restorationdisplay: nonefor.bn-resize-handleand.bn-side-menu— dismisses hover UI whose Reacthoveredstate was set before hiding (sincepointer-events: nonedoes not trigger syntheticmouseleave)Mousedown / mouseup protection
window blurlistener resets held state when mouse is released outside the windowOverlay exemptions
pointer-events: auto+cursor: autoFiles changed
src/index.css— cursor auto-hide CSS rulessrc/features/editor/hooks/useCursorAutoHide.ts— mousedown/mouseup/blur listeners