This commit is contained in:
Adria Navarro 2023-09-22 13:07:02 +02:00
parent 1272414a57
commit 7ad05930e1
5 changed files with 6 additions and 12 deletions

View File

@ -14,7 +14,6 @@
export let autocomplete = false
export let sort = false
export let autoWidth = false
export let fetchTerm = null
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
@ -91,7 +90,6 @@
{options}
isPlaceholder={!arrayValue.length}
{autocomplete}
bind:fetchTerm
bind:searchTerm
bind:open
{useFetch}

View File

@ -35,7 +35,6 @@
export let autoWidth = false
export let autocomplete = false
export let sort = false
export let fetchTerm = null
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
@ -82,7 +81,7 @@
}
const getFilteredOptions = (options, term, getLabel) => {
if (autocomplete && term && !fetchTerm) {
if (autocomplete && term && !useFetch) {
const lowerCaseTerm = term.toLowerCase()
return options.filter(option => {
return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)
@ -163,9 +162,8 @@
>
{#if autocomplete}
<Search
value={useFetch ? fetchTerm : searchTerm}
on:change={event =>
useFetch ? (fetchTerm = event.detail) : (searchTerm = event.detail)}
value={searchTerm}
on:change={event => (searchTerm = event.detail)}
{disabled}
placeholder="Search"
/>

View File

@ -25,7 +25,6 @@
export let tag = null
export let customPopoverOffsetBelow
export let customPopoverMaxHeight
export let fetchTerm = null
export let searchTerm = null
const dispatch = createEventDispatcher()
@ -67,7 +66,6 @@
<Picker
on:click
bind:open
bind:fetchTerm
bind:searchTerm
{quiet}
{id}

View File

@ -16,7 +16,7 @@
export let sort = false
export let autoWidth = false
export let autocomplete = false
export let fetchTerm = null
export let searchTerm = null
export let useFetch = false
export let customPopoverHeight
@ -41,7 +41,7 @@
{autoWidth}
{autocomplete}
{customPopoverHeight}
bind:fetchTerm
bind:searchTerm
{useFetch}
on:change={onChange}
on:click

View File

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