Should Input.Number value accept a string?
See original GitHub issueIssue
Every version of the schema I’ve seen says the value
property of Input.Number
only accepts a number.
However, I’ve tried using a string for the value in both Web Chat and Microsoft Teams and they work. Both of these inputs render the same:
{
"type": "Input.Number",
"id": "id-number",
"value": 7,
"placeholder": "Placeholder text"
},
{
"type": "Input.Number",
"id": "id-numberString",
"value": "7",
"placeholder": "Placeholder text"
},
Which is correct? Should the schema say “number
, string
” instead of just number
? Or are those renderers operating contrary to the schema?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
HTML input type="number" still returning a string when ...
there is nothing you can do. HTML Input element is documented to return the value in String type representing number. See my explanation...
Read more >Why the number input is the worst input
When the number input contains an invalid value and you retrieve the value, you get a blank string. · Valid numbers include more...
Read more >Why take a String input instead of int input for a number?
5 Answers 5 ... Simply because the user's guess is most probably entered through a mechanism which only supports entering chars, or strings,...
Read more ><input type="number"> - HTML: HyperText Markup Language
A number input is considered valid when empty and when a single number is entered, but is otherwise invalid. If the required attribute...
Read more >Check user Input is a Number or String in Python
In this lesson, you will learn how to check user input is a number or string in Python. We will also cover how...
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
+1, though behavior has changed slightly. On Web Chat, we have used “value”: 1 in the past, which would show the default value as 1. However when bumping to 1.23 recently there was a change where the 1 is no longer inserted as a value, so the input is blank. “value”: “1” does work, however.
The above code shows an empty input in the visualizer.
Particularly in contrast with the min and max properties, this seems like an odd inconsistency.
For now Web Chat is using the workaround. 😃
Thanks for looking into this stale issue shalinijoshi19; Resetting staleness. @v-kydela FYI.