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

Disable Native Option #33

Closed
tim-field opened this issue Feb 25, 2015 · 9 comments
Closed

Disable Native Option #33

tim-field opened this issue Feb 25, 2015 · 9 comments

Comments

@tim-field
Copy link

Chrome is now using its native date picker. Is there a way to force the polyfill version ? ( I realise that isn't much of a polyfill, but I / my client only wants the native for mobile devices )

@chemerisuk
Copy link
Owner

@timbofield anyway I think it's a good idea to have such option. What about data-native attribute that might have values "desktop", "mobile" that allows to suppress native control on demand? If it doesn't exist, then current "true polyfill" checks are applied to determine which strategy to use. Otherwise you can control if you want native control or not on element-level. Or you want to set such setting globally?

@tim-field
Copy link
Author

@chemerisuk yes I was just thinking that as well, data-native would be good. I see this line has been added at some point, wasn't in older versions.

https://github.com/chemerisuk/better-dateinput-polyfill/blob/master/src/main.js#L13

@tim-field tim-field changed the title Chrome default Disable Native Option Feb 25, 2015
@tim-field
Copy link
Author

Setting globally would be a 'nice to have' feature

@chemerisuk
Copy link
Owner

@timbofield yeah, the second argument of DOM.extend is a functor, that controls if live extension is applied or not and it accepts the matched element. Therefore the implementation is pretty simple. Just need to find some free time on it :)

I think it's better to keep this option on element-level only. It's kind of making a polyfill to be not a true polyfill, so some developers might be confused. Therefore an implementor should understand clearly what he or she is doing, that's why always specify data-native for every new input[type=date]element.

@chemerisuk
Copy link
Owner

Released in 1.5.2 ;)

@tim-field
Copy link
Author

Fantastic, its working well :) Thanks

@BrodaNoel
Copy link

Please, add documentation about it.

@chemerisuk
Copy link
Owner

will do

@chemerisuk
Copy link
Owner

@BrodaNoel readme was updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants