Mottie/Keyboard — pull request #233 by BrandonLWhite (2014-02-07 18:27:05+00:00)
Title: Resolved issue with FlashOfUnstyledContent (FOUC) when using jQuery Mobile

There is a 10ms delay after the keyboard is displayed before it actually fires 'visible.keyboard'.
Since the jQuery Mobile plugin restyles the controls in response to the 'visible.keyboard' event, the user will experience FlashOfUnstyledContent (FOUC). I guess technically it's not unstyled -- just the wrong style.

This fix, or workaround rather, avoids this FOUC by first setting the visibility to hidden, then after the mobile styles are applied we set it visible.

This may not be ideal -- but I couldn't think of a better way to approach this without purposely eliminating the setTimeout delay in the core code or by adding another event before the setTimeout.

You don't see the issue in the demo page for jQM, because its not showing keyboards in response to touches/clicks. If you'd prefer to see some test cases, I can put together some fiddles later.

Also, I didn't get a chance to do the minified version. I'm expecting to do another PR, hopefully by Monday.