refactor(timepicker): forward events, remove dispatch

This commit is contained in:
Eric Liu 2019-12-29 19:37:15 -08:00
commit bb18cdf797
3 changed files with 16 additions and 15 deletions

View file

@ -23,18 +23,21 @@
<div class={cx('--time-picker__input')}>
{#if labelText}
<label
for={id}
class={cx('--label', hideLabel && '--visually-hidden', disabled && '--label--disabled')}>
class={cx('--label', hideLabel && '--visually-hidden', disabled && '--label--disabled')}
for={id}>
{labelText}
</label>
{/if}
<input
data-invalid={invalid || undefined}
class={cx('--time-picker__input-field', '--text-input', light && '--text-input--light', invalid && '--text-input--invalid')}
on:change
on:input
on:input={({ target }) => {
value = target.value;
}}
on:focus
on:blur
{pattern}
{placeholder}
{maxlength}
@ -42,7 +45,6 @@
{type}
{value}
{disabled} />
</div>
<slot />
</div>