File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/site/src/routes/demo/select Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4
4
Note: you need to provide a function as `key` that returns a unique string
5
5
for each option.
6
6
7
- It *must* be a string. (Hence the `${fruit.id}` part.)
7
+ It *must* be a string. (Hence the `${fruit && fruit.id}` part. That
8
+ returns a string for the numberic `id` field and the `null` value even.)
8
9
-->
9
- <Select key ={(fruit ) => ` ${fruit .id } ` } bind:value ={valueA } label =" Standard" >
10
+ <Select
11
+ key ={(fruit ) => ` ${fruit && fruit .id } ` }
12
+ bind:value ={valueA }
13
+ label =" Standard"
14
+ >
10
15
<Option value ={null } />
11
16
{#each fruits as fruit (fruit .label )}
12
17
<Option value ={fruit }>{fruit .label }</Option >
21
26
<div >
22
27
<Select
23
28
variant =" filled"
24
- key ={(fruit ) => ` ${fruit .id } ` }
29
+ key ={(fruit ) => ` ${fruit && fruit .id } ` }
25
30
bind:value ={valueB }
26
31
label =" Filled"
27
32
>
39
44
<div >
40
45
<Select
41
46
variant =" outlined"
42
- key ={(fruit ) => ` ${fruit .id } ` }
47
+ key ={(fruit ) => ` ${fruit && fruit .id } ` }
43
48
bind:value ={valueC }
44
49
label =" Outlined"
45
50
>
You can’t perform that action at this time.
0 commit comments