File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/BootstrapBlazor/Components/AutoComplete Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,23 @@ export function init(id, invoke) {
5858 invoke . invokeMethodAsync ( 'TriggerChange' , e . target . value ) ;
5959 } ) ;
6060
61- Input . composition ( input , async v => {
61+ let filterDuration = duration ;
62+ if ( filterDuration === 0 ) {
63+ filterDuration = 200 ;
64+ }
65+ const filterCallback = debounce ( async v => {
66+ await invoke . invokeMethodAsync ( 'TriggerFilter' , v ) ;
67+ el . classList . remove ( 'is-loading' ) ;
68+ } , filterDuration ) ;
69+
70+ Input . composition ( input , v => {
6271 const useInput = input . getAttribute ( 'data-bb-input' ) !== 'false' ;
6372 if ( isPopover === false && useInput ) {
6473 el . classList . add ( 'show' ) ;
6574 }
6675
6776 el . classList . add ( 'is-loading' ) ;
68- await invoke . invokeMethodAsync ( 'TriggerFilter' , v ) ;
69- el . classList . remove ( 'is-loading' ) ;
77+ filterCallback ( v ) ;
7078 } ) ;
7179
7280 if ( window . BootstrapBlazor . AutoComplete === void 0 ) {
You can’t perform that action at this time.
0 commit comments