diff --git a/packages/bbui/src/Form/Core/TextField.svelte b/packages/bbui/src/Form/Core/TextField.svelte index 7afd8f86c3..cbc062d99a 100644 --- a/packages/bbui/src/Form/Core/TextField.svelte +++ b/packages/bbui/src/Form/Core/TextField.svelte @@ -21,7 +21,7 @@ let focus = false const updateValue = newValue => { - if (readonly) { + if (readonly || disabled) { return } if (type === "number") { @@ -32,14 +32,14 @@ } const onFocus = () => { - if (readonly) { + if (readonly || disabled) { return } focus = true } const onBlur = event => { - if (readonly) { + if (readonly || disabled) { return } focus = false @@ -47,14 +47,14 @@ } const onInput = event => { - if (readonly || !updateOnChange) { + if (readonly || !updateOnChange || disabled) { return } updateValue(event.target.value) } const updateValueOnEnter = event => { - if (readonly) { + if (readonly || disabled) { return } if (event.key === "Enter") { @@ -66,10 +66,12 @@ if (type === "bigint") { return "numeric" } - return type === "number" ? "decimal" : "text" + return type === "number" ? +"decimal" : "text" } onMount(() => { + if (disabled) return; focus = autofocus if (focus) field.focus() }) @@ -119,4 +121,8 @@ .spectrum-Textfield { width: 100%; } + + input:focus:hover::placeholder { + color: var(--grey-8) !important; + }