mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix: close overlays on window click (#761)
This commit is contained in:
parent
7e3b0bc1cd
commit
af26bdb10a
8 changed files with 24 additions and 16 deletions
|
@ -192,12 +192,13 @@
|
|||
$: if ($hasCalendar && !calendar && inputRef) initCalendar();
|
||||
</script>
|
||||
|
||||
<svelte:body
|
||||
<svelte:window
|
||||
on:click="{({ target }) => {
|
||||
if (!calendar || !calendar.isOpen) return;
|
||||
if (datePickerRef && datePickerRef.contains(target)) return;
|
||||
if (!calendar.calendarContainer.contains(target)) calendar.close();
|
||||
}}" />
|
||||
}}"
|
||||
/>
|
||||
|
||||
<div
|
||||
class:bx--form-item="{true}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue