File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -452,27 +452,22 @@ export default class DatePicker extends Component<
452452 }
453453 } ;
454454
455- safeFocus = ( ) => {
456- setTimeout ( ( ) => {
457- this . input ?. focus ?.( { preventScroll : true } ) ;
458- } , 0 ) ;
459- } ;
460-
461- safeBlur = ( ) => {
462- setTimeout ( ( ) => {
463- this . input ?. blur ?.( ) ;
464- } , 0 ) ;
465- } ;
466-
467455 setFocus = ( ) => {
468- this . safeFocus ( ) ;
456+ this . input ?. focus ?. ( { preventScroll : true } ) ;
469457 } ;
470458
471459 setBlur = ( ) => {
472- this . safeBlur ( ) ;
460+ this . input ?. blur ?. ( ) ;
473461 this . cancelFocusInput ( ) ;
474462 } ;
475463
464+ deferBlur = ( ) => {
465+ requestAnimationFrame ( ( ) => {
466+ console . log ( "reached" ) ;
467+ this . setBlur ( ) ;
468+ } ) ;
469+ } ;
470+
476471 setOpen = ( open : boolean , skipSetBlur : boolean = false ) : void => {
477472 this . setState (
478473 {
@@ -490,7 +485,7 @@ export default class DatePicker extends Component<
490485 focused : skipSetBlur ? prev . focused : false ,
491486 } ) ,
492487 ( ) => {
493- ! skipSetBlur && this . setBlur ( ) ;
488+ ! skipSetBlur && this . deferBlur ( ) ;
494489
495490 this . setState ( { inputValue : null } ) ;
496491 } ,
You canāt perform that action at this time.
0 commit comments