Use event bubbling intead of hacky workaround
I'm not going to describe what the hacky workaround was, but you can see for yourself if you're so interested.
This commit is contained in:
parent
e7bed614c9
commit
ca92f79d7a
|
@ -4,16 +4,14 @@
|
|||
export let hidden = false
|
||||
export let autofocus = false
|
||||
export let value = null
|
||||
export let onfocus = () => {}
|
||||
export let onblur = () => {}
|
||||
</script>
|
||||
|
||||
<div class="input-container">
|
||||
<label class="input-container__label">{label}</label>
|
||||
{#if hidden}
|
||||
<input type="password" tabindex="{tabindex}" class="input-container__input focusable" bind:value={value} {autofocus} on:focus={onfocus} on:blur={onblur}/>
|
||||
<input type="password" tabindex="{tabindex}" class="input-container__input focusable" bind:value={value} {autofocus} on:focus on:blur/>
|
||||
{:else}
|
||||
<input type="text" tabindex="{tabindex}" class="input-container__input focusable" bind:value={value} {autofocus} on:focus={onfocus} on:blur={onblur}/>
|
||||
<input type="text" tabindex="{tabindex}" class="input-container__input focusable" bind:value={value} {autofocus} on:focus on:blur/>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -135,8 +135,8 @@
|
|||
tabindex={chatbox?.messages?.length || 0}
|
||||
autofocus={true}
|
||||
label='Compose'
|
||||
onfocus={onComposeBoxFocus}
|
||||
onblur={() => { centerSoftkeyLabel = 'Compose' }}
|
||||
on:focus={onComposeBoxFocus}
|
||||
on:blur={() => { centerSoftkeyLabel = 'Compose' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue