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

IE10 data-placeholder-focus ignored #31

Closed
Jawvig opened this issue Jul 29, 2013 · 3 comments
Closed

IE10 data-placeholder-focus ignored #31

Jawvig opened this issue Jul 29, 2013 · 3 comments

Comments

@Jawvig
Copy link

Jawvig commented Jul 29, 2013

On IE10, setting the data-placeholder-focus attribute to false does not result in the same behaviour as IE < 10 and Safari & Chrome. Instead the placeholder text still disappears when the input gets focus.

This is probably because IE10 purportedly supports placeholder, but losing the placeholder text on focus is part of its default behaviour.

@jamesallardice
Copy link
Owner

As you said, IE10 natively supports the placeholder attribute. Therefore, the polyfill has no effect whatsoever. The main code of this polyfill is wrapped in the following statement (where nativeSupport refers to the result of a feature test):

if (!Placeholders.nativeSupport) {
    // apply the polyfill
}

The idea of this script is not to modify the behaviour of the native solution where one exists. If the browser chooses to hide the placeholder on focus, this script does not provide any way to override that.

The reason the choice is offered in browsers where the polyfill does take effect is that both hide-on-focus and hide-on-input are commonly seen in native solutions, and the specification states that both are acceptable.

@Jawvig
Copy link
Author

Jawvig commented Jul 29, 2013

Thanks for the explanation. I see and accept the argument that this pollyfill does not exist to change behaviour where it is supported, but it is still true that the lack of a normalized end behaviour is slightly irritating! Thanks for the good work, by the way.

@jamesallardice
Copy link
Owner

Yeah, I agree that the lack of a standardised behaviour is annoying. There are numerous differences across implementations - some browsers allow you to style the placeholder for example, while others do not. Unfortunately, browser variations are just something we have to live with!

Thanks, I appreciate 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