fix(select): forward missing focus, input events #501

Fixes #501
This commit is contained in:
Eric Y Liu 2021-07-14 13:04:26 -07:00
commit 6a7fdd183b
4 changed files with 14 additions and 1 deletions

View file

@ -3242,6 +3242,8 @@ None.
| Event name | Type | Detail |
| :--------- | :--------- | :------------------ |
| change | dispatched | <code>string</code> |
| input | forwarded | -- |
| focus | forwarded | -- |
| blur | forwarded | -- |
## `SelectItem`

View file

@ -9304,6 +9304,8 @@
],
"events": [
{ "type": "dispatched", "name": "change", "detail": "string" },
{ "type": "forwarded", "name": "input", "element": "select" },
{ "type": "forwarded", "name": "focus", "element": "select" },
{ "type": "forwarded", "name": "blur", "element": "select" }
],
"typedefs": [],

View file

@ -119,6 +119,8 @@
on:change="{({ target }) => {
selectedValue.set(target.value);
}}"
on:input
on:focus
on:blur
>
<slot />
@ -160,6 +162,8 @@
on:change="{({ target }) => {
selectedValue.set(target.value);
}}"
on:input
on:focus
on:blur
>
<slot />

View file

@ -99,6 +99,11 @@ export interface SelectProps
export default class Select extends SvelteComponentTyped<
SelectProps,
{ change: CustomEvent<string>; blur: WindowEventMap["blur"] },
{
change: CustomEvent<string>;
input: WindowEventMap["input"];
focus: WindowEventMap["focus"];
blur: WindowEventMap["blur"];
},
{ default: {}; labelText: {} }
> {}