Merge pull request #18310 from silentoplayz/fix-integrations-menu-closing-outside-click

fix: prevent integrations menu from closing when valves modal is open
This commit is contained in:
Tim Jaeryang Baek 2025-10-13 20:58:58 -05:00 committed by GitHub
commit 2b3b2e4aa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -117,6 +117,11 @@
let showValvesModal = false;
let selectedValvesType = 'tool'; // 'tool' or 'function'
let selectedValvesItemId = null;
let integrationsMenuCloseOnOutsideClick = true;
$: if (!showValvesModal) {
integrationsMenuCloseOnOutsideClick = true;
}
$: onChange({
prompt,
@ -944,6 +949,9 @@
on:save={async () => {
await tick();
}}
on:close={() => {
integrationsMenuCloseOnOutsideClick = true;
}}
/>
{#if loaded}
@ -1463,11 +1471,13 @@
bind:webSearchEnabled
bind:imageGenerationEnabled
bind:codeInterpreterEnabled
closeOnOutsideClick={integrationsMenuCloseOnOutsideClick}
onShowValves={(e) => {
const { type, id } = e;
selectedValvesType = type;
selectedValvesItemId = id;
showValvesModal = true;
integrationsMenuCloseOnOutsideClick = false;
}}
onClose={async () => {
await tick();

View File

@ -42,6 +42,7 @@
export let onShowValves: Function;
export let onClose: Function;
export let closeOnOutsideClick = true;
let show = false;
let tab = '';
@ -93,6 +94,7 @@
<Dropdown
bind:show
{closeOnOutsideClick}
on:change={(e) => {
if (e.detail === false) {
onClose();

View File

@ -9,12 +9,15 @@
export let show = false;
export let side = 'bottom';
export let align = 'start';
export let closeOnOutsideClick = true;
const dispatch = createEventDispatcher();
</script>
<DropdownMenu.Root
bind:open={show}
closeFocus={false}
{closeOnOutsideClick}
onOpenChange={(state) => {
dispatch('change', state);
}}