chore(input): forward keydown event to TextInput, PasswordInput

This commit is contained in:
Eric Liu 2020-07-30 16:37:26 -07:00
commit ea12dbe503
3 changed files with 17 additions and 2 deletions

View file

@ -166,6 +166,7 @@
on:input={({ target }) => {
value = target.value;
}}
on:keydown
on:focus
on:blur />
<button

View file

@ -22,9 +22,19 @@
<TextInputSkeleton hideLabel />
</div>
{:else if story === 'password-visibility'}
<PasswordInput {...$$props} aria-level="" />
<PasswordInput
{...$$props}
aria-level=""
on:keydown={(e) => {
console.log('on:keydown', e);
}} />
{:else if story === 'controlled'}
<PasswordInput {...$$props} {type} />
<PasswordInput
{...$$props}
{type}
on:keydown={(e) => {
console.log('on:keydown', e);
}} />
<div>
<button
on:click={() => {
@ -44,6 +54,9 @@
bind:ref
{...$$props}
bind:value
on:keydown={(e) => {
console.log('on:keydown', e);
}}
on:change={() => {
console.log('change');
}} />

View file

@ -138,6 +138,7 @@
on:input={({ target }) => {
value = target.value;
}}
on:keydown
on:focus
on:blur />
</div>