Skip to content

fix(core): use onMouseEnter/Leave in WebView to prevent duplicate events#32

Open
Sigmabrogz wants to merge 1 commit intoprozilla-os:mainfrom
Sigmabrogz:fix/webview-mouseenter-leave
Open

fix(core): use onMouseEnter/Leave in WebView to prevent duplicate events#32
Sigmabrogz wants to merge 1 commit intoprozilla-os:mainfrom
Sigmabrogz:fix/webview-mouseenter-leave

Conversation

@Sigmabrogz
Copy link

Summary

Fixes the issue where difficulty dropdown in Minesweeper (and other WebView apps) closes immediately.

Problem

Closes #28
The WebView component was using onMouseOver and onMouseOut which bubble up from children and trigger continuously as the mouse moves over internal elements like the iframe or native dropdowns. This caused rapid firing of window.focus() in onMouseOut, immediately blurring the dropdown inside the iframe and causing it to close.

Solution

Replaced onMouseOver and onMouseOut with onMouseEnter and onMouseLeave which only trigger when the mouse actually enters or leaves the parent container, avoiding bubbling from children elements.

Testing

  • Local testing confirmed native selects (like Minesweeper difficulty) now stay open.
    (Note: main branch currently has unrelated TS compilation errors for @prozilla-os/shared which appear to be pre-existing, but my changes only modify the WebView component safely).

Checklist

  • Focused fix to WebView.tsx
  • No unrelated changes
  • AI assistance used for debugging the event bubbling root cause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Difficulty of Minesweeper can only be changed in standalone mode

1 participant