mirror of
https://github.com/stablyai/orca.git
synced 2026-10-13 08:02:52 +00:00
Revert "fix(tab-bar): dismiss tab context menu on window blur for webview clicks (#1274)"
This reverts commit 61909fff03.
This commit is contained in:
@@ -97,20 +97,6 @@ export default function BrowserTab({
|
||||
return () => window.removeEventListener(CLOSE_ALL_CONTEXT_MENUS_EVENT, closeMenu)
|
||||
}, [])
|
||||
|
||||
// Why: Electron <webview> elements run in a separate process, so clicking
|
||||
// inside one never dispatches a pointerdown on the renderer document. Radix
|
||||
// DropdownMenu relies on document pointerdown for outside-click detection,
|
||||
// so it misses webview clicks. Listening for window blur catches the moment
|
||||
// focus leaves the renderer (including into a webview).
|
||||
useEffect(() => {
|
||||
if (!menuOpen) {
|
||||
return
|
||||
}
|
||||
const dismiss = (): void => setMenuOpen(false)
|
||||
window.addEventListener('blur', dismiss)
|
||||
return () => window.removeEventListener('blur', dismiss)
|
||||
}, [menuOpen])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
||||
@@ -178,20 +178,6 @@ export default function EditorFileTab({
|
||||
return () => window.removeEventListener(CLOSE_ALL_CONTEXT_MENUS_EVENT, closeMenu)
|
||||
}, [])
|
||||
|
||||
// Why: Electron <webview> elements run in a separate process, so clicking
|
||||
// inside one never dispatches a pointerdown on the renderer document. Radix
|
||||
// DropdownMenu relies on document pointerdown for outside-click detection,
|
||||
// so it misses webview clicks. Listening for window blur catches the moment
|
||||
// focus leaves the renderer (including into a webview).
|
||||
useEffect(() => {
|
||||
if (!menuOpen) {
|
||||
return
|
||||
}
|
||||
const dismiss = (): void => setMenuOpen(false)
|
||||
window.addEventListener('blur', dismiss)
|
||||
return () => window.removeEventListener('blur', dismiss)
|
||||
}, [menuOpen])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
||||
@@ -149,20 +149,6 @@ export default function SortableTab({
|
||||
return () => window.removeEventListener(CLOSE_ALL_CONTEXT_MENUS_EVENT, closeMenu)
|
||||
}, [])
|
||||
|
||||
// Why: Electron <webview> elements run in a separate process, so clicking
|
||||
// inside one never dispatches a pointerdown on the renderer document. Radix
|
||||
// DropdownMenu relies on document pointerdown for outside-click detection,
|
||||
// so it misses webview clicks. Listening for window blur catches the moment
|
||||
// focus leaves the renderer (including into a webview).
|
||||
useEffect(() => {
|
||||
if (!menuOpen) {
|
||||
return
|
||||
}
|
||||
const dismiss = (): void => setMenuOpen(false)
|
||||
window.addEventListener('blur', dismiss)
|
||||
return () => window.removeEventListener('blur', dismiss)
|
||||
}, [menuOpen])
|
||||
|
||||
// Why: while editing, suppress dnd-kit drag listeners and tab-activation/double-click
|
||||
// handlers so typing/clicking inside the inline input doesn't start a drag, re-open the
|
||||
// editor, or steal focus away from the input. We still spread `attributes` unconditionally
|
||||
|
||||
Reference in New Issue
Block a user