themesberg / themesberg/flowbite
Number input step for Control buttons
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9.4k
- Forks
- 862
- PR merge metrics
- No merged PRs in 30d
Description
I've experimented with the new Number input component, particularly the control buttons section, where the attributes data-input-counter-min and data-input-counter-max function seamlessly. However, I noticed the absence of an attribute to define the step increment, which would allow it for numerical adjustments beyond a one-by-one basis.
In this context, I would like to propose a feature request for a control to manage the step increment effect. A data-input-counter-step attribute, where you specify the desired numerical increment for the control buttons, would be highly beneficial.
Additionally, it would be advantageous to introduce another data attribute to ensure the inputted number is a multiple of the defined step. For example, a data-input-counter-only-multiple could enforce this constraint. Consider the following input example:
<input type="text" data-input-counter data-input-counter-min="0" data-input-counter-max="20" data-input-counter-only-multiple data-input-counter-step="5" value="5" />
With this configuration:
- It would be impossible to enter a number that is not a multiple of 5. For instance, entering 7 would automatically adjust the input to 10.
- If the maximum or minimum values are not multiples of 5, the nearest valid multiples within the specified range would be used. For example, if data-input-counter-max="22" and data-input-counter-min="1", the highest and lowest values would adjust to 20 and 5, respectively.
Here is an example illustrating the step effect on an HTML number input:
HTML Number Input with Step
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Number input component's control buttons and existing data-input-counter-min and data-input-counter-max behavior. Compare the requested data-input-counter-step and data-input-counter-only-multiple behavior with the linked HTML number-input example. Done means the documented example adjusts values by the configured step and enforces valid multiples within the minimum and maximum range.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, tailwindcss
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100