svelte-headless-components
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -56,2 +56,3 @@ import type { ComputeConfig } from 'svelte-floating-ui'; | ||
onSelect: Writable<OptionSelect>; | ||
onChange: Writable<OptionSelect>; | ||
onAdd: Writable<AddOption>; | ||
@@ -58,0 +59,0 @@ }; |
@@ -36,2 +36,3 @@ import { BROWSER } from 'esm-env'; | ||
onSelect: writable(), | ||
onChange: writable(), | ||
onAdd: writable(), | ||
@@ -133,2 +134,3 @@ }; | ||
} | ||
const previousSelected = option.selected ? true : false; | ||
if (!option.isMulti) { | ||
@@ -154,2 +156,5 @@ const optionsFlat = Select.toFlat(get(this.state.options)); | ||
this.events.onSelect.set(option); | ||
if (option.selected !== previousSelected) { | ||
this.events.onChange.set(option); | ||
} | ||
if (this.shouldClose(option)) { | ||
@@ -156,0 +161,0 @@ this.state.isOpen.set(false); |
@@ -11,2 +11,3 @@ import { SvelteComponent } from "svelte"; | ||
select: CustomEvent<OptionItem>; | ||
change: CustomEvent<OptionItem>; | ||
add: CustomEvent<AddOption>; | ||
@@ -13,0 +14,0 @@ open: CustomEvent<void>; |
{ | ||
"name": "svelte-headless-components", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42868
860