File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
components/custom/SearchableSelect Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,12 @@ export let disabled = false
1212export let required = false
1313
1414let element = {}
15-
1615let randomId = generateRandomID (' dataList-' )
1716
18- $: internalChoice = choice
19-
2017const dispatch = createEventDispatcher ()
2118
22- const onChange = () => {
19+ const onChange = (e ) => {
20+ const internalChoice = e .target .value
2321 options[internalChoice] && dispatch (' chosen' , options[internalChoice])
2422 choice = internalChoice
2523 element .blur ()
@@ -78,10 +76,9 @@ const onChange = () => {
7876 list ={randomId }
7977 placeholder =" "
8078 bind:this ={element }
81- bind: value ={internalChoice }
79+ value ={choice }
8280 on:change ={onChange }
83- on:blur ={() => dispatch (' check' , internalChoice )}
84- on:focus ={() => (internalChoice = ' ' )}
81+ on:blur ={(e ) => dispatch (' check' , e .target .value )}
8582 />
8683 <span class ="placeholder" >{placeholder }</span >
8784</label >
You can’t perform that action at this time.
0 commit comments