Skip to content

fix(editor): suppress hover UI and interactions during cursor auto-hide#116

Merged
j4rviscmd merged 4 commits intomainfrom
fix/cursor-hide-fix
Mar 29, 2026
Merged

fix(editor): suppress hover UI and interactions during cursor auto-hide#116
j4rviscmd merged 4 commits intomainfrom
fix/cursor-hide-fix

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

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

  1. cursor: none — visual hide of the mouse pointer
  2. pointer-events: none — prevents new hover events on child elements; document-level mousemove still fires for cursor restoration
  3. display: none for .bn-resize-handle and .bn-side-menu — dismisses hover UI whose React hovered state was set before hiding (since pointer-events: none does not trigger synthetic mouseleave)

Mousedown / mouseup protection

  • Idle timer is suspended while a mouse button is held (text selection drag)
  • window blur listener resets held state when mouse is released outside the window

Overlay exemptions

  • User-opened UI (dialogs, menus, dropdowns) retains pointer-events: auto + cursor: auto
  • Hover-triggered UI (resize handles, side menu) is hidden instead

Files changed

  • src/index.css — cursor auto-hide CSS rules
  • src/features/editor/hooks/useCursorAutoHide.ts — mousedown/mouseup/blur listeners

j4rviscmd and others added 2 commits March 29, 2026 10:24
- 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>
@j4rviscmd j4rviscmd added the bug Something isn't working label Mar 29, 2026
j4rviscmd and others added 2 commits March 29, 2026 10:30
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>
@j4rviscmd j4rviscmd merged commit 8c36987 into main Mar 29, 2026
2 checks passed
@j4rviscmd j4rviscmd deleted the fix/cursor-hide-fix branch March 29, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant