solid-select icon indicating copy to clipboard operation
solid-select copied to clipboard

How to define predefined values ?

Open gxanshu opened this issue 1 year ago • 0 comments

is there any way to pre define the value in the Select box here is the thing that i want to do let suppose

const [value, setValue] = createSignal<string[]>(['apple', 'banana'])
const preValue = ['apple']

and then use that state in the select component

<Select
     multiple
     options={value()}
      value={preValue} // want to do something like that to already add apple and banana as selected
      onChange={setValue}
 />

gxanshu avatar Aug 11 '23 05:08 gxanshu