diff --git a/packages/bbui/src/Form/Core/Search.svelte b/packages/bbui/src/Form/Core/Search.svelte
index dbc8582ac3..b26c9567c0 100644
--- a/packages/bbui/src/Form/Core/Search.svelte
+++ b/packages/bbui/src/Form/Core/Search.svelte
@@ -2,10 +2,11 @@
import "@spectrum-css/search/dist/index-vars.css"
import { createEventDispatcher } from "svelte"
- export let value = ""
+ export let value = null
export let placeholder = null
export let disabled = false
export let id = null
+ export let updateOnChange = true
const dispatch = createEventDispatcher()
let focus = false
@@ -23,6 +24,13 @@
updateValue(event.target.value)
}
+ const onInput = event => {
+ if (!updateOnChange) {
+ return
+ }
+ updateValue(event.target.value)
+ }
+
const updateValueOnEnter = event => {
if (event.key === "Enter") {
updateValue(event.target.value)
@@ -44,15 +52,18 @@
{
+ if (readonly || !updateOnChange) {
+ return
+ }
+ updateValue(event.target.value)
}
const updateValueOnEnter = event => {
@@ -66,16 +73,19 @@
{/if}
diff --git a/packages/bbui/src/Form/Input.svelte b/packages/bbui/src/Form/Input.svelte
index 07ebf4f4db..fcab178182 100644
--- a/packages/bbui/src/Form/Input.svelte
+++ b/packages/bbui/src/Form/Input.svelte
@@ -11,6 +11,7 @@
export let disabled = false
export let readonly = false
export let error = null
+ export let updateOnChange = true
const dispatch = createEventDispatcher()
const onChange = e => {
@@ -21,6 +22,7 @@
diff --git a/packages/bbui/src/Form/Search.svelte b/packages/bbui/src/Form/Search.svelte
index d41ecd4d6e..b5a6c17b4a 100644
--- a/packages/bbui/src/Form/Search.svelte
+++ b/packages/bbui/src/Form/Search.svelte
@@ -8,6 +8,7 @@
export let labelPosition = "above"
export let placeholder = null
export let disabled = false
+ export let updateOnChange = true
const dispatch = createEventDispatcher()
const onChange = e => {
@@ -18,11 +19,14 @@