@@ -29,6 +29,7 @@ import { tryToDispatchKoliBriEvent } from '../../utils/events';
2929import { getRenderStates } from '../input/controller' ;
3030import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText' ;
3131import { SingleSelectController } from './controller' ;
32+ import { EventDetail } from '../../schema/interfaces/EventDetail' ;
3233
3334/**
3435 * @slot - The input field label.
@@ -104,13 +105,21 @@ export class KolSingleSelect implements SingleSelectAPI {
104105 if ( this . state . _disabled ) {
105106 return ;
106107 } else {
107- const emptyValue = '' ;
108+ const emptyValue = null ;
108109 this . _focusedOptionIndex = - 1 ;
109110 this . _value = emptyValue ;
110- this . _inputValue = emptyValue ;
111+ this . _inputValue = '' ;
111112 this . _filteredOptions = [ ...this . state . _options ] ;
112- this . controller . onFacade . onInput ( new CustomEvent ( 'input' , { bubbles : true , detail : { name : this . state . _name , value : emptyValue } } ) , true , emptyValue ) ;
113- this . controller . onFacade . onChange ( new CustomEvent ( 'change' , { bubbles : true , detail : { name : this . state . _name , value : emptyValue } } ) , emptyValue ) ;
113+
114+ this . controller . onFacade . onInput (
115+ new CustomEvent < EventDetail > ( 'input' , { bubbles : true , detail : { name : this . state . _name as string , value : emptyValue } } ) ,
116+ true ,
117+ { value : emptyValue } ,
118+ ) ;
119+ this . controller . onFacade . onChange (
120+ new CustomEvent < EventDetail > ( 'change' , { bubbles : true , detail : { name : this . state . _name as string , value : emptyValue } } ) ,
121+ { value : emptyValue } ,
122+ ) ;
114123 }
115124 }
116125
0 commit comments