Skip to content

Commit 0aebc72

Browse files
committed
Disabled ws-select if no type is provided
1 parent 504979b commit 0aebc72

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/viewer/src/project/browse/SearchFilter.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<!-- Field Picker -->
124124
<FieldSelect bind:value={selectedField} />
125125
<!-- Writing System Picker -->
126-
<WsSelect bind:value={selectedWs} wsType={selectedField?.ws ?? 'analysis-vernacular'} />
126+
<WsSelect bind:value={selectedWs} wsType={selectedField?.ws} />
127127
</div>
128128
<!-- Text Box: on mobile, wraps to new line -->
129129
<div class="flex flex-row gap-2 flex-1">

frontend/viewer/src/project/browse/filter/WsSelect.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
77
const wsService = useWritingSystemService();
88
9-
let {value = $bindable(), wsType}: { value: string[], wsType: WritingSystemSelection } = $props();
10-
let writingSystems = $derived(wsService.pickWritingSystems(wsType));
9+
let {value = $bindable(), wsType}: { value: string[], wsType: WritingSystemSelection | undefined } = $props();
10+
let writingSystems = $derived(wsType ? wsService.pickWritingSystems(wsType) : []);
1111
watch(() => writingSystems, () => {
1212
value = writingSystems.map(ws => ws.wsId);
1313
});
1414
</script>
15-
<Select.Root type="multiple" bind:value>
15+
<Select.Root disabled={!wsType} type="multiple" bind:value>
1616
<Select.Trigger class="flex-1">
1717
{#if value.length === 0}
1818
<span class="text-muted-foreground">{$t`Writing System`}</span>

0 commit comments

Comments
 (0)