Text input node - mode set to 'Number' - dislikes a decimal point

Using a text input node with a mode of 'Number' I am finding that when entering a value that contains a decimal point, it is being flagged in red as an invalid value and expects a whole number.
I don't know what would be as it is a perfectly valid number.

Does anybody know a way around that?

  • what platform and os release are you using?
  • what version of NR and node.js? (see startup log)
  • where are you seeing it flagged in red?

can you provide your flow, I don't seem to have any issue

Check your country settings of the os.

That is a good point, @davej perhaps you should be using comma, or something else.

No, I am in the US. A comma cannot be entered.
This happens when trying to enter a numeric value with a decimal point into a Text input node set with a mode of "Number".
As can be seen by the popup tool tip it expects a whole number and displays the value in red.

Capture

Raspberry PI. Browser is on Windows 10 Enterprise using Edge (Chromium).

24 Aug 13:10:00 - [info] Node.js version: v12.18.3
24 Aug 13:10:00 - [info] Linux 5.4.51-v7l+ arm LE
24 Aug 13:10:00 - [info] Loading palette nodes
24 Aug 13:10:02 - [info] Dashboard version 2.23.2 started at /ui

[{"id":"4ff691cd.4e807","type":"ui_text_input","z":"a8343255.189ef","name":"","label":"","tooltip":"","group":"cf134869.6a9fc8","order":12,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":250,"y":2520,"wires":[["dec1050f.56fb68"]]},{"id":"54184877.976508","type":"inject","z":"a8343255.189ef","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.150","payloadType":"num","x":90,"y":2520,"wires":[["4ff691cd.4e807"]]},{"id":"dec1050f.56fb68","type":"debug","z":"a8343255.189ef","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":2520,"wires":[]},{"id":"cf134869.6a9fc8","type":"ui_group","z":"","name":"Batches","tab":"456ebde9.b22184","order":1,"disp":true,"width":"6","collapse":false},{"id":"456ebde9.b22184","type":"ui_tab","z":"","name":"Batch Setup","icon":"dashboard","order":4,"disabled":false,"hidden":false}]

Yes, you are right actually. It does send the value ok but colours it red. Perhaps it is only supposed to work with integers.

Yes it sends the value but flags it in error in red.
Nowhere does any doc states that it requires a whole number - simply that it requires to be numeric.
Methinks a bug.
@knolleary @dceejay

What version of NR are you running? With your flow, I see the issue but I can not recreate it with new nodes.

Please try this experiment, add another text-input node and set t to the same settings and see what happens with it.

Found it! - it has to do with setting the delay to 0. Change it anything but 0 and it works

Thanks for finding the bug.
I do not want to set it to any other value that zero as I want to wait for the user to tab away from the field.

Per the documentation:
The Delay (default : 300ms) sets the amount of time in milliseconds before the output is sent. Setting to 0 waits for "Enter" or "Tab" key to send. Enter will send payload but remain in focus. Tab will send payload and move to next field. Clicking elsewhere will also send the payload.

If I add a timer value, I get this passed through which is completely wrong if I enter a value of 1 2 3:
Capture

Hopefully this can be fixed .

Already fixed in master with this PR - https://github.com/node-red/node-red-dashboard/pull/609

1 Like

@dceejay What a splendid chap you are.
I did search but didn't find anything for this in the forum before I posted.
Does this get pushed out in a future patch release?

Yes, usually I wait for a few to build up, unless something badly broken.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.