mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 09:21:22 +00: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:
parent
d83e1caab4
commit
d8dcb82cde
1 changed files with 2 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue