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

Webkit Header Form Flash #2

Open
nickcatal opened this issue Apr 30, 2012 · 4 comments
Open

Webkit Header Form Flash #2

nickcatal opened this issue Apr 30, 2012 · 4 comments

Comments

@nickcatal
Copy link
Member

On the website template our placeholder fix seems to cause a flash on webkit browsers as the content is rendered before the jquery plugin can fake the placeholder.

We need a solution here that is cross browser (the placeholder="" isn't perfect) but is there a polyfill that won't cause the flash?

@imjared
Copy link
Contributor

imjared commented Apr 30, 2012

Few things we could try:

I'm pretty indifferent and think function is more important than complying with the spec. I'd lean toward solution 1 but if we're going to use modernizr, we should cram it all into an externally-hosted file and link to it. I don't want to add bloat to the existing template.

I'll defer to you and submit a pull request based on what you think we should go with.

@nickcatal
Copy link
Member Author

Yeah, I'm aware that it violates the spec. Problem is that it also clears out the placeholder when you click on it. Don't know if that is an important consideration, but if it is even with a polyfill it might not be the best solution for us.

What about something like this? http://fuelyourcoding.com/scripts/infield/

We could host it on a separate S3 bucket for javascript. Not a big deal there.

@imjared
Copy link
Contributor

imjared commented Apr 30, 2012

Could work. If we're using a plugin though, we may still run into the flash of unstyled content. Maybe we can try moving the current scripts to the top? Putting it at the bottom defers their loading which is technically a best practice but can (and does) result in the flash since it is parsed after the main.

The more I think about this, the more I think just wrapping up modernizr if (!Modernizr.input.placeholder)+ a plugin would be our best bet. Users with modern browsers would get no flash and optimal experience. Users with an old browser would get a suboptimal but still working experience.

@nickcatal
Copy link
Member Author

Yeah, I agree, the modernizer approach makes the most sense.

Feel free to try it out and if that works send a pull request. Include a custom placeholder-only modernizer build in the repo if possible, otherwise I'll handle that.

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

No branches or pull requests

2 participants