uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.66k stars 6.07k forks source link

Conflict with Chrome build-in datepicker #122

Open dennischeunggroupon opened 12 years ago

dennischeunggroupon commented 12 years ago

Since recent (I am using 20.0.1132.43 m), chrome will have a build-in datepicker for . https://plus.google.com/102860501900098846931/posts/hTcMLVNKnec

However, it cause duplicated with "bootstrap-datepicker".

bootstrap-datepicker should auto-detect and disable either and keep one active.

DazWorrall commented 12 years ago

As a workaround, if you're using Modernizr, you can conditionally load the picker based on the browsers support (or lack of):

        if (!Modernizr.inputtypes.date) {
            $("input[type='date']").datepicker();
        }
SlashmanX commented 12 years ago

Another workaround if you want to have the bootstrap-datepicker for all browsers i.e. maintain consistency is to simply change the input to 'text'. Of course that might not be strictly 'valid' but it's an easy hack

clawfire commented 12 years ago

@SlashmanX : hum yes but when you deal with some framework construction element or just want to use the html5 form validation it's a little bit violent

web-dev commented 12 years ago

See my comment here: https://plus.google.com/102860501900098846931/posts/hTcMLVNKnec

Its possible to remove the little arrow used to trigger the date picker with the following style:

input::-webkit-calendar-picker-indicator {
    display: none;
}
SlashmanX commented 12 years ago

@web-dev I've noticed that while these stops the Chrome picker from showing, selecting a date using the bootstrap-datepicker doesn't actually update the field.

EDIT: Just noticed the 2nd part of the comment on G+ regarding setting the date using yyyy-mm-dd. My mistake

IHL commented 9 years ago

Confirming the comment by SlashmanX. Of these suggestions, the use of Modernizr or changing the input element type to text are the ones that work. Merely suppressing the built-in style on Chrome doesn't fix the issue of the input conflict.

Rich2020 commented 9 years ago

Is there any solution to this yet? I've tried setting the input to text and have also tried with Modernizr, but neither works... I even tried disabling the native chrome datepicker.

Firefox works fine, though!

hebbet commented 9 years ago

On Sun, Aug 23, 2015 at 7:19 PM, Richard notifications@github.com wrote:

Firefox works fine, though!

firefox doesn't support date as an input an falls back to type="text"

Rich2020 commented 9 years ago

I am using type="text", but validation fails. It seems to default to the American date format, despite specifying a UK date format. Any ideas?