@@ -217,6 +217,12 @@ export default class Sample extends React.Component<any, SampleState> {
217217 ] ;
218218 }
219219
220+ private setImplicitValue ( ctx : QueryBuilderSearchValueContext , value : any ) {
221+ queueMicrotask ( ( ) => {
222+ ctx . implicit . value = value ;
223+ } ) ;
224+ }
225+
220226 private normalizeTimeValue = ( value : unknown ) : Date | null => {
221227 if ( ! value ) return null ;
222228 if ( value instanceof Date ) return value ;
@@ -278,9 +284,7 @@ export default class Sample extends React.Component<any, SampleState> {
278284
279285 if ( ! value || value === currentKey ) return ;
280286
281- setTimeout ( ( ) => {
282- ctx . implicit . value = this . regionOptions . find ( option => option . value === value ) ?? null ;
283- } ) ;
287+ this . setImplicitValue ( ctx , this . regionOptions . find ( option => option . value === value ) ?? null ) ;
284288 } } >
285289 { this . regionOptions . map ( option => (
286290 < IgrSelectItem key = { option . value } value = { option . value } >
@@ -309,9 +313,7 @@ export default class Sample extends React.Component<any, SampleState> {
309313 if ( ! e . detail . checked ) return ;
310314 const numericValue = Number ( e . detail . value ) ;
311315 if ( ctx . implicit . value === numericValue ) return ;
312- setTimeout ( ( ) => {
313- ctx . implicit . value = numericValue ;
314- } ) ;
316+ this . setImplicitValue ( ctx , numericValue ) ;
315317 } } >
316318 < span > { option . text } </ span >
317319 </ IgrRadio >
@@ -339,9 +341,7 @@ export default class Sample extends React.Component<any, SampleState> {
339341 disabled = { ! isEnabled }
340342 click = { ( sender : any ) => sender . show ( ) }
341343 change = { ( sender : any ) => {
342- setTimeout ( ( ) => {
343- ctx . implicit . value = sender . value ;
344- } ) ;
344+ this . setImplicitValue ( ctx , sender . value ) ;
345345 } } >
346346 </ IgrDatePicker >
347347 ) ;
@@ -360,9 +360,7 @@ export default class Sample extends React.Component<any, SampleState> {
360360 value = { currentValue }
361361 disabled = { isDisabled }
362362 change = { ( sender : any ) => {
363- setTimeout ( ( ) => {
364- ctx . implicit . value = sender . value ;
365- } ) ;
363+ this . setImplicitValue ( ctx , sender . value ) ;
366364 } } >
367365 < div slot = "prefix" >
368366 < IgrIcon name = "clock" collection = "material" />
@@ -399,11 +397,9 @@ export default class Sample extends React.Component<any, SampleState> {
399397 type = { isNumber ? 'number' : 'text' }
400398 input = { ( sender : any ) => {
401399 const value = sender . value ;
402- setTimeout ( ( ) => {
403- ctx . implicit . value = isNumber
404- ? value === '' ? null : Number ( value )
405- : value ;
406- } ) ;
400+ this . setImplicitValue ( ctx , isNumber
401+ ? value === '' ? null : Number ( value )
402+ : value ) ;
407403 } } >
408404 </ IgrInput >
409405 ) ;
0 commit comments