Implement cc-input-number
See original GitHub issueContext
We need an <input type=number>
with -/+ buttons.
We won’t be using the existing <cc-input-text>
because it already does a lot of things and they’re not really useful for input number.
Requirements
-----------------
| - | 10 | + |
-----------------
- Needs to look like
<cc-input-text>
(same borders, spacing…) <input type=number>
under the hood- Text aligned to the right by default (we may consider a CSS custom prop)
- We need to hide the arrow keys that some browser display for such fields
- (-) minus button on the left of the field
- (+) plus button on the right of the field
Inputs (props)
- label
- value
- min
- max
- step
- readonly
- disabled
Outputs (events)
- value
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
<input type="number"> - HTML: HyperText Markup Language
<input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.
Read more >HTML input type="number"
The <input type="number"> defines a field for entering a number. Use the following attributes to specify restrictions: max - specifies the maximum value...
Read more >Only numbers. Input number in React - javascript
I came up with a better solution. Use type='tel' along with a pattern regex within the input component itself. The nuts and bolts...
Read more >How to force Input field to enter numbers only using ...
Now forcing input field type=”text” to accept numeric values only by using Javascript or jQuery. You can also set type=”tel” attribute in the ......
Read more >Number input type | Can I use... Support tables for HTML5, ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies ... Number input type. - LS. Form field type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Will investigate and give it the native behavior logic for the controls as it’s the case causing trouble 👍
Will do, I will comment with some screenshots when it’s ready 😉
I have also tried it on IPad, it’s the larger version of the number keyboard, will do some more tests tho 🤓
Sure 😄
I’m considering aligning the content at the center. Could we do right aligned by default et provide a
--cc-input-number-align
custom property?