Why has Chrome on Android's native HTML5 date picker become really slow?

前端 未结 2 648
后悔当初
后悔当初 2021-02-13 00:35

I have a date picker on my site that just uses the default html5 date picker.

I\'ve noticed that up until a couple of weeks ago, it was working fine but ever since a rec

2条回答
  •  灰色年华
    2021-02-13 01:17

    For a bit more info, I did some playing around with setting no min/max, max only, and min and max. Each has different behaviour/performance.

    No min or max - clicking in Android will be very slow

    
    

    Max only - clicking in Android will set your default value to 01/01/0001 - the first day ever. Not useful

    
    

    Min and max - default date is today, and it loads very quickly!

    
    

    https://jsfiddle.net/gpjc3xam/16/


    Update

    For anyone using this solution with Angular, please note that a min date in the year 0001 will not work. It seems that the year 100 is the lowest Javascript will allow...

提交回复
热议问题