mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-24 03:59:50 +03:00
fire onChange event on clear button (#611)
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
12f66bc433
commit
438292bebf
@ -28,14 +28,14 @@
|
|||||||
export let value: string | undefined = undefined
|
export let value: string | undefined = undefined
|
||||||
export let placeholder: string = 'placeholder'
|
export let placeholder: string = 'placeholder'
|
||||||
|
|
||||||
let textHTML: HTMLElement
|
let textHTML: HTMLInputElement
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-between editbox" style={width ? 'width: ' + width : ''} on:click={() => textHTML.focus()}>
|
<div class="flex-between editbox" style={width ? 'width: ' + width : ''} on:click={() => textHTML.focus()}>
|
||||||
<div class="mr-2"><Icon {icon} size={'small'} /></div>
|
<div class="mr-2"><Icon {icon} size={'small'} /></div>
|
||||||
<input bind:this={textHTML} type="text" bind:value {placeholder} on:change/>
|
<input bind:this={textHTML} type="text" bind:value {placeholder} on:change/>
|
||||||
{#if value}
|
{#if value}
|
||||||
<div class="ml-2 btn" on:click={() => { value = '' }}>
|
<div class="ml-2 btn" on:click={() => { textHTML.value = ''; textHTML.dispatchEvent(new Event('change')) }}>
|
||||||
<Tooltip label={ui.string.Clear}>
|
<Tooltip label={ui.string.Clear}>
|
||||||
<div class="scale-75"><Icon icon={IconClose} size={'small'} /></div>
|
<div class="scale-75"><Icon icon={IconClose} size={'small'} /></div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
Loading…
Reference in New Issue
Block a user