@@ -28,6 +28,7 @@ import { tryToDispatchKoliBriEvent } from '../../utils/events';
2828import { getRenderStates } from '../input/controller' ;
2929import { InternalUnderlinedBadgeText } from '../span/InternalUnderlinedBadgeText' ;
3030import { SingleSelectController } from './controller' ;
31+ import { EventDetail } from '../../schema/interfaces/EventDetail' ;
3132
3233/**
3334 * @slot - The input field label.
@@ -93,13 +94,21 @@ export class KolSingleSelect implements SingleSelectAPI {
9394 if ( this . state . _disabled ) {
9495 return ;
9596 } else {
96- const emptyValue = '' ;
97+ const emptyValue = null ;
9798 this . _focusedOptionIndex = - 1 ;
9899 this . _value = emptyValue ;
99- this . _inputValue = emptyValue ;
100+ this . _inputValue = '' ;
100101 this . _filteredOptions = [ ...this . state . _options ] ;
101- this . controller . onFacade . onInput ( new CustomEvent ( 'input' , { bubbles : true , detail : { name : this . state . _name , value : emptyValue } } ) , true , emptyValue ) ;
102- this . controller . onFacade . onChange ( new CustomEvent ( 'change' , { bubbles : true , detail : { name : this . state . _name , value : emptyValue } } ) , emptyValue ) ;
102+
103+ this . controller . onFacade . onInput (
104+ new CustomEvent < EventDetail > ( 'input' , { bubbles : true , detail : { name : this . state . _name as string , value : emptyValue } } ) ,
105+ true ,
106+ { value : emptyValue } ,
107+ ) ;
108+ this . controller . onFacade . onChange (
109+ new CustomEvent < EventDetail > ( 'change' , { bubbles : true , detail : { name : this . state . _name as string , value : emptyValue } } ) ,
110+ { value : emptyValue } ,
111+ ) ;
103112 }
104113 }
105114
0 commit comments