flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

Bug: Number input Control buttons min value doesn't allow typing

Open Eduardo-XavierPaula opened this issue 7 months ago • 0 comments

When using the Input Number with control buttons, I am unable to type a value smaller than the data-input-counter-min value, as it always reverts to the minimum value. Consequently, it is not possible to type a number larger than the minimum value if it starts with a digit less than the data-input-counter-min.

To reproduce this behavior, use the following input:

<input type="text" id="bedrooms-input" data-input-counter data-input-counter-min="5" data-input-counter-max="100" value="10" required />

When attempting to type a number between 10 and 49, the value changes back to 5 before I can finish typing.

I believe this behavior is due to an onInput() event that changes the value before I complete typing. It would be ideal to modify this event to an onchange() or an onblur() event, allowing the verification to wait until the user finishes typing the desired number before validating it.

image

  • Browser: [e.g. Chrome]
  • Flowbite Version: 2.4.1

Eduardo-XavierPaula avatar Jul 16 '24 13:07 Eduardo-XavierPaula