Commit 223b1af 1 parent d9480df commit 223b1af Copy full SHA for 223b1af
File tree 2 files changed +8
-3
lines changed
lib/components/ui/combobox
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 7
7
import {tick } from " svelte"
8
8
9
9
export let multi: boolean = false
10
+ export let placeholder: string = " Select..."
10
11
11
12
export let options = [
12
13
{value: " Option 1" , label: " option 1" },
21
22
let triggerButton // Reference to the trigger button
22
23
23
24
$ : selectedValue = multi
24
- ? options .filter (f => value .includes (f .value )).map (f => f .label ).join (" , " ) || " Select frameworks... "
25
- : options .find (f => f .value === value )?.label ?? " Select a framework... "
25
+ ? options .filter (f => value .includes (f .value )).map (f => f .label ).join (" , " ) || placeholder
26
+ : options .find (f => f .value === value )?.label ?? placeholder
26
27
27
28
function closeAndFocusTrigger() {
28
29
open = false
Original file line number Diff line number Diff line change 4
4
<div class =" flex justify-center" >
5
5
<div class =" max-w-screen-lg w-full px-8" >
6
6
<div >
7
- <Combobox multi ={true }/>
7
+ <Combobox options ={[
8
+ {value: " a" , label: " A" },
9
+ {value: " b" , label: " B" },
10
+ {value: " c" , label: " C" },
11
+ ]} multi ={true }/>
8
12
</div >
9
13
</div >
10
14
</div >
You can’t perform that action at this time.
0 commit comments