Fix role filtering

This commit is contained in:
rxdn 2024-09-14 22:33:29 +01:00
parent 69d63b43e4
commit 8030340371
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@
searchable={searchable} searchable={searchable}
clearable={isClearable} clearable={isClearable}
itemId={optionIdentifier} itemId={optionIdentifier}
label={labelProperty}
debounceWait={loadOptionsInterval} debounceWait={loadOptionsInterval}
{loadOptions} {loadOptions}
{placeholder} {placeholder}
@ -50,6 +51,7 @@
export let disabled = false; export let disabled = false;
export let optionIdentifier; export let optionIdentifier;
export let labelProperty;
export let nameMapper = (x) => x; export let nameMapper = (x) => x;
let searchable = isSearchable && selectedValue == undefined; let searchable = isSearchable && selectedValue == undefined;

View File

@ -3,7 +3,7 @@
{/if} {/if}
<WrappedSelect {placeholder} optionIdentifier="id" items={roles} {disabled} <WrappedSelect {placeholder} optionIdentifier="id" items={roles} {disabled}
bind:selectedValue={value} nameMapper={labelMapper} on:change /> bind:selectedValue={value} nameMapper={labelMapper} labelProperty="name" on:change />
<script> <script>
import {onMount} from 'svelte' import {onMount} from 'svelte'