jtsage / jtsage-datebox

A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, FomanticUI, and UIKit (or others)
http://datebox.jtsage.dev/
Other
474 stars 166 forks source link

The lockInput property should be (properly) configurable #302

Closed lilyannehall closed 10 years ago

lilyannehall commented 10 years ago

Here we set an option for lockInput which determines whether or not to add the readonly attribute to the target input field: https://github.com/jtsage/jquery-mobile-datebox/blob/master/js/jqm-datebox.core.js#L27

And here we set the readonly attribute based on that option's value: https://github.com/jtsage/jquery-mobile-datebox/blob/master/js/jqm-datebox.core.js#L841

However, when calling the plugin and passing this option, it has no effect.

$('.datepicker').datebox({
    blackDates: $.holidays,
    highDates: [$.currentDate],
    lockInput: false
}).one('datebox_close', function() {
    $(this).datebox({ highDates: null });
});

So, I am forced to manually remove it. This is to fix the Samsung (maybe others) Android keyboard from skipping the input when using the "next" and "previous" buttons.

jtsage commented 10 years ago

Indeed. my first guess is that there is a particular version of android that only looks for the readonly attribute, not the value of it. No matter, moving it outside the loop and only setting it if it is true.