fix issue with user searching

This commit is contained in:
Peter Clement 2023-03-02 14:30:04 +00:00
parent 2bc0e988af
commit aa02c0ca30
4 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,7 @@
export let sort = false export let sort = false
export let autoWidth = false export let autoWidth = false
export let fetchTerm = null export let fetchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -86,6 +87,7 @@
isPlaceholder={!value?.length} isPlaceholder={!value?.length}
{autocomplete} {autocomplete}
bind:fetchTerm bind:fetchTerm
{useFetch}
{isOptionSelected} {isOptionSelected}
{getOptionLabel} {getOptionLabel}
{getOptionValue} {getOptionValue}

View File

@ -33,6 +33,7 @@
export let autocomplete = false export let autocomplete = false
export let sort = false export let sort = false
export let fetchTerm = null export let fetchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
export let align = "left" export let align = "left"
export let footer = null export let footer = null
@ -150,9 +151,9 @@
> >
{#if autocomplete} {#if autocomplete}
<Search <Search
value={fetchTerm ? fetchTerm : searchTerm} value={useFetch ? fetchTerm : searchTerm}
on:change={event => on:change={event =>
fetchTerm ? (fetchTerm = event.detail) : (searchTerm = event.detail)} useFetch ? (fetchTerm = event.detail) : (searchTerm = event.detail)}
{disabled} {disabled}
placeholder="Search" placeholder="Search"
/> />

View File

@ -17,6 +17,7 @@
export let autoWidth = false export let autoWidth = false
export let autocomplete = false export let autocomplete = false
export let fetchTerm = null export let fetchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -41,6 +42,7 @@
{autocomplete} {autocomplete}
{customPopoverHeight} {customPopoverHeight}
bind:fetchTerm bind:fetchTerm
{useFetch}
on:change={onChange} on:change={onChange}
on:click on:click
/> />

View File

@ -257,6 +257,7 @@
<div class="select"> <div class="select">
<Multiselect <Multiselect
bind:fetchTerm={userSearchTerm} bind:fetchTerm={userSearchTerm}
useFetch
placeholder="All users" placeholder="All users"
label="Users" label="Users"
autocomplete autocomplete