File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function createAlertDialogBuilder(options?: DialogOptions & MDCAlertControlerOpt
66
66
moduleName : options . view as string
67
67
} ) ;
68
68
if ( view . parent ) {
69
- view . parent . _removeView ( view )
69
+ view . parent . _removeView ( view ) ;
70
70
}
71
71
view . cssClasses . add ( CSSUtils . MODAL_ROOT_VIEW_CSS_CLASS ) ;
72
72
const modalRootViewCssClasses = CSSUtils . getSystemCssClasses ( ) ;
@@ -475,6 +475,13 @@ export function prompt(arg: any): Promise<PromptResult> {
475
475
476
476
showDialog ( dlg , options ) ;
477
477
if ( options . autoFocus ) {
478
+ // seems not to work if called too soon so we call it again
479
+ // once the view is focused and ready
480
+ textField . once ( 'focus' , ( ) => {
481
+ setTimeout ( ( ) => {
482
+ textField . requestFocus ( ) ;
483
+ } , 100 ) ;
484
+ } ) ;
478
485
textField . requestFocus ( ) ;
479
486
}
480
487
} catch ( ex ) {
@@ -559,6 +566,13 @@ export function login(arg: any): Promise<LoginResult> {
559
566
) ;
560
567
showDialog ( dlg , options ) ;
561
568
if ( options . autoFocus ) {
569
+ // seems not to work if called too soon so we call it again
570
+ // once the view is focused and ready
571
+ userNameTextField . once ( 'focus' , ( ) => {
572
+ setTimeout ( ( ) => {
573
+ userNameTextField . requestFocus ( ) ;
574
+ } , 100 ) ;
575
+ } ) ;
562
576
userNameTextField . requestFocus ( ) ;
563
577
}
564
578
} catch ( ex ) {
You can’t perform that action at this time.
0 commit comments