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 | | Event name | Type | Detail |
| :--------- | :--------- | :------------------ | | :--------- | :--------- | :------------------ |
| change | dispatched | <code>string</code> | | change | dispatched | <code>string</code> |
| input | forwarded | -- |
| focus | forwarded | -- |
| blur | forwarded | -- | | blur | forwarded | -- |
## `SelectItem` ## `SelectItem`

View file

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

View file

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

View file

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