Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved issue with FlashOfUnstyledContent (FOUC) when using jQuery Mobile #233

Merged
merged 1 commit into from
Feb 8, 2014

Conversation

BrandonLWhite
Copy link
Contributor

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 on 'beforeVisible.keyboard' so that the user doesn't see anything during the delay, 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.

@Mottie
Copy link
Owner

Mottie commented Feb 8, 2014

Thanks @BrandonLWhite!

I haven't done much testing on mobile since I have a very old android smart phone (v2.3.5) which I don't use the internet on LOL. So thanks for taking the time to help improve this project!

Rob

Mottie added a commit that referenced this pull request Feb 8, 2014
Resolved issue with FlashOfUnstyledContent (FOUC) when using jQuery Mobile
@Mottie Mottie merged commit 06eb203 into Mottie:master Feb 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants