bootstrap-touchspin
bootstrap-touchspin copied to clipboard
Support for readonly input elements
It would be nice to have support for readonly
input element.
This could be done by changing
if (originalinput.is(':disabled')) {
return;
}
to
if (originalinput.is(':disabled,[readonly]')) {
return;
}
Wondering if the suggested solution is enough and won't have undesired side effects. I'd love to have the support for readonly
prop too.
UPDATE: I can confirm that the proposed solution works without any known side effects so far. I'll leave it to @mpryvkin to offer a PR or upto @istvan-ujjmeszaros to fix that in an update.
This is fixed in v4.5.2. FYI the buttons are being disabled when the input is readonly to avoid any confusion.
@istvan-ujjmeszaros, thank you for your reply. Try using keys UP and DOWN in a readonly
element, the event handlers do not check for readonly
property and modify the value of the element.
Thanks @mpryvkin, the issue with the UP/DOWN keys and the mouse wheel on readonly inputs is fixed in v4.6.0