kopia lustrzana https://github.com/shoelace-style/shoelace
Added sl-invalid event type
rodzic
21bef1c2ea
commit
f8d8291caa
|
@ -30,3 +30,4 @@ export { default as SlLazyLoadEvent } from './sl-lazy-load';
|
|||
export { default as SlCancelEvent } from './sl-cancel';
|
||||
export { default as SlFinishEvent } from './sl-finish';
|
||||
export { default as SlStartEvent } from './sl-start';
|
||||
export { default as SlInvalidEvent } from './sl-invalid';
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
type SlInvalidEvent = CustomEvent<Record<PropertyKey, never>>;
|
||||
|
||||
declare global {
|
||||
interface GlobalEventHandlersEventMap {
|
||||
'sl-invalid': SlInvalidEvent;
|
||||
}
|
||||
}
|
||||
|
||||
export default SlInvalidEvent;
|
|
@ -357,10 +357,11 @@ export class FormControlController implements ReactiveController {
|
|||
* event will be cancelled before being dispatched.
|
||||
*/
|
||||
emitInvalidEvent(originalInvalidEvent?: Event) {
|
||||
const slInvalidEvent = new CustomEvent<void>('sl-invalid', {
|
||||
const slInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('sl-invalid', {
|
||||
bubbles: false,
|
||||
composed: false,
|
||||
cancelable: true
|
||||
cancelable: true,
|
||||
detail: {}
|
||||
});
|
||||
|
||||
if (!originalInvalidEvent) {
|
||||
|
|
Ładowanie…
Reference in New Issue