Skip to content

Commit

Permalink
Update Dropdown.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazemre committed Dec 7, 2024
1 parent 6a7f721 commit a712daf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fluid-ui-svelte/src/lib/components/Dropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
shouldCloseOnClickOutside: boolean;
dropdownTrigger: Snippet<[options: { isOpen: boolean; toggleDropdown: Function }]>;
dropdownContent: Snippet<[options: { isOpen: boolean; toggleDropdown: Function }]>;
triggerRawElement: HTMLElement;
contentRawElement: HTMLElement;
triggerRawElement?: HTMLElement;
contentRawElement?: HTMLElement;
} = $props();
const componentOptions: DropdownOptions = {
Expand All @@ -38,7 +38,7 @@
if (shouldCloseOnClickOutside) {
document.addEventListener("click", (e) => {
if (isOpen && e.target) {
if (!triggerRawElement.contains(e.target as HTMLElement) && !contentRawElement.contains(e.target as HTMLElement)) {
if (!triggerRawElement!.contains(e.target as HTMLElement) && !contentRawElement!.contains(e.target as HTMLElement)) {
isOpen = false;
}
}
Expand Down

0 comments on commit a712daf

Please sign in to comment.