File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,10 +63,21 @@ $.fn.addMobile = function(options){
6363 base . mobile_setup ( ) ;
6464 }
6565
66- // Setup mobile theme on keyboard once it is visible
67- base . $el . bind ( 'visible.keyboard' , function ( ) {
66+ // Setup mobile theme on keyboard once it is visible.
67+ // Note: There is a 10ms delay after the keyboard is displayed before it actually fires 'visible.keyboard'.
68+ // Since we are restyling here, the user will experience FlashOfUnstyledContent (FOUC).
69+ // This is avoided by first setting the visibility to hidden, then after the mobile styles are applied we
70+ // set it visible.
71+ //
72+ base . $el . on ( 'beforeVisible.keyboard' , function ( ) {
73+ if ( base . mobile_initialized !== true ) {
74+ base . $keyboard . css ( "visibility" , "hidden" ) ;
75+ }
76+ } )
77+ . on ( 'visible.keyboard' , function ( ) {
6878 if ( base . mobile_initialized !== true ) {
6979 base . mobile_setup ( ) ;
80+ base . $keyboard . css ( "visibility" , "visible" ) ;
7081 }
7182 } ) ;
7283
You can’t perform that action at this time.
0 commit comments