From 7ad05930e1e9d29b83a5c778a48d2e3e0145e975 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 22 Sep 2023 13:07:02 +0200 Subject: [PATCH] Simplify --- packages/bbui/src/Form/Core/Multiselect.svelte | 2 -- packages/bbui/src/Form/Core/Picker.svelte | 8 +++----- packages/bbui/src/Form/Core/Select.svelte | 2 -- packages/bbui/src/Form/Multiselect.svelte | 4 ++-- .../pages/builder/portal/account/auditLogs/index.svelte | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/bbui/src/Form/Core/Multiselect.svelte b/packages/bbui/src/Form/Core/Multiselect.svelte index f99d553830..bd1b7dfd2c 100644 --- a/packages/bbui/src/Form/Core/Multiselect.svelte +++ b/packages/bbui/src/Form/Core/Multiselect.svelte @@ -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} diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 1a0ef3b9c7..c1d0ac1f27 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -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} - useFetch ? (fetchTerm = event.detail) : (searchTerm = event.detail)} + value={searchTerm} + on:change={event => (searchTerm = event.detail)} {disabled} placeholder="Search" /> diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index f8de28de0c..5384308418 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -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 @@