mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-02 01:42:53 -05:00
fix: file preview closes on any click when opened from the Controls menu (#33831)
Opening a file from Controls → Files and clicking anything in its window, such as the Preview tab, closed the window together with the menu. Clicks inside a window opened from a menu no longer count as clicks outside it, so the preview stays open. Fixes #33828
This commit is contained in:
1 parent
d83e1caab4
commit
d8dcb82cde
1 file changed
+2
-2
@@ -330,10 +330,10 @@
|
||||
if (!(event.target instanceof Node)) return;
|
||||
if (triggerEl?.contains(event.target)) return;
|
||||
if (contentEl?.contains(event.target)) return;
|
||||
// Submenus and listboxes can be portaled outside contentEl.
|
||||
// Submenus, listboxes and modals can be portaled outside contentEl.
|
||||
const portaled =
|
||||
event.target instanceof Element
|
||||
? event.target.closest('[role="menu"], [role="listbox"]')
|
||||
? event.target.closest('[role="menu"], [role="listbox"], [aria-modal="true"]')
|
||||
: null;
|
||||
if (portaled && !portaled.contains(triggerEl)) return;
|
||||
event.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user