Standardise text area updates
This commit is contained in:
parent
691c9a9bd1
commit
95bef3e90a
|
@ -7,7 +7,6 @@
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let error = null
|
export let error = null
|
||||||
export let id = null
|
export let id = null
|
||||||
export let updateOnChange = true
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
@ -33,8 +32,7 @@
|
||||||
class="spectrum-Textfield-input"
|
class="spectrum-Textfield-input"
|
||||||
{disabled}
|
{disabled}
|
||||||
{id}
|
{id}
|
||||||
on:blur={onChange}
|
on:blur={onChange}>{value || ''}</textarea>
|
||||||
on:change={updateOnChange ? onChange : null}>{value || ''}</textarea>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
export let placeholder = null
|
export let placeholder = null
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let error = null
|
export let error = null
|
||||||
export let updateOnChange = true
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
const onChange = e => {
|
const onChange = e => {
|
||||||
|
@ -19,11 +18,5 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Field {label} {labelPosition} {disabled} {error}>
|
<Field {label} {labelPosition} {disabled} {error}>
|
||||||
<TextArea
|
<TextArea {error} {disabled} {value} {placeholder} on:change={onChange} />
|
||||||
{error}
|
|
||||||
{disabled}
|
|
||||||
{value}
|
|
||||||
{placeholder}
|
|
||||||
{updateOnChange}
|
|
||||||
on:change={onChange} />
|
|
||||||
</Field>
|
</Field>
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
<CoreTextArea
|
<CoreTextArea
|
||||||
value={$fieldState.value}
|
value={$fieldState.value}
|
||||||
on:change={e => fieldApi.setValue(e.detail)}
|
on:change={e => fieldApi.setValue(e.detail)}
|
||||||
updateOnChange={false}
|
|
||||||
disabled={$fieldState.disabled}
|
disabled={$fieldState.disabled}
|
||||||
error={$fieldState.error}
|
error={$fieldState.error}
|
||||||
id={$fieldState.fieldId}
|
id={$fieldState.fieldId}
|
||||||
|
|
Loading…
Reference in New Issue