bootstrap-touchspin icon indicating copy to clipboard operation
bootstrap-touchspin copied to clipboard

Support for readonly input elements

Open mpryvkin opened this issue 6 years ago • 1 comments

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;
}

mpryvkin avatar May 23 '18 05:05 mpryvkin

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.

fr0z3nfyr avatar Dec 18 '18 07:12 fr0z3nfyr

This is fixed in v4.5.2. FYI the buttons are being disabled when the input is readonly to avoid any confusion.

istvan-ujjmeszaros avatar Apr 03 '23 16:04 istvan-ujjmeszaros

@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.

mpryvkin avatar Apr 03 '23 17:04 mpryvkin

Thanks @mpryvkin, the issue with the UP/DOWN keys and the mouse wheel on readonly inputs is fixed in v4.6.0

istvan-ujjmeszaros avatar Apr 04 '23 19:04 istvan-ujjmeszaros