Text Input (date) sends value 3 times

Edit - I changed the title. At first I thought it only happens if I set flow context, but nope.

If I select 31st December with this flow (beware of importing it, your dashboard 2 may become broke)

[{"id":"e5d957b7e23cc99c","type":"ui-text-input","z":"654f55124d2a7bb4","group":"e98980ce6b5e6c07","name":"Input date","label":"First date","order":0,"width":"3","height":"1","topic":"topic","topicType":"msg","mode":"date","tooltip":"","delay":300,"passthru":true,"sendOnDelay":false,"sendOnBlur":true,"sendOnEnter":true,"className":"","clearable":false,"sendOnClear":false,"icon":"","iconPosition":"left","iconInnerPosition":"inside","x":560,"y":480,"wires":[["431ee5c22c68c030"]]},{"id":"431ee5c22c68c030","type":"debug","z":"654f55124d2a7bb4","name":"Selected date","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":480,"wires":[]},{"id":"e98980ce6b5e6c07","type":"ui-group","name":"Group1","page":"5aa4fd64330a7f73","width":"12","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"5aa4fd64330a7f73","type":"ui-page","name":"This is ui-page /page1","ui":"d45641ed6d39fea1","path":"/page1","icon":"home","layout":"grid","theme":"0d92c765bfad87e6","order":1,"className":"","visible":"true","disabled":"false"},{"id":"d45641ed6d39fea1","type":"ui-base","name":"This is my ui-base","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"default","titleBarStyle":"default"},{"id":"0d92c765bfad87e6","type":"ui-theme","name":"Basic Blue Theme","colors":{"surface":"#4d58ff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

The debug usually but not inevitably shows the date 3 times
image

What am I doing wrong?
This is the input node config:

ps
You get a shedload of additional stuff when you export a single dashboard 2 widget. If only there was a way to export (or import) it without it's page, base, tab, group, etc, etc!

You can isolate just the node you want to copy from the JSON like this:

[{"id":"e5d957b7e23cc99c","type":"ui-text-input","z":"654f55124d2a7bb4","group":"e98980ce6b5e6c07","name":"Input date","label":"First date","order":0,"width":"3","height":"1","topic":"topic","topicType":"msg","mode":"date","tooltip":"","delay":300,"passthru":true,"sendOnDelay":false,"sendOnBlur":true,"sendOnEnter":true,"className":"","clearable":false,"sendOnClear":false,"icon":"","iconPosition":"left","iconInnerPosition":"inside","x":560,"y":480,"wires":[["431ee5c22c68c030"]]}]

That should allow importing just that node but without the configuration nodes. Then you can select the Group you want it to be in, in the nodes edit dialog.

It is likely sending additional messages because you have the check-boxes selected to do that. When set only to delay X ms it only sends one message after a very short or 0 milliseconds if you set it that way.

1 Like

Ah. So that's why there's a scrollbar on the config screen!
Actually I had "Focus leave" and "Press enter" ticked (the default) and I didn't press enter.
But after changing it to "After 300ms" it sends only once.

I don't understand why it sends it 3 times with those options ticked.
However it does explain why the dashboard was not getting refreshed until I switched browser tabs - the tab didn't lose focus (until I switched to the editor tab to see the debug, and back again).
Why is this option the default?
"I want you to send this input but not until I switch to another of my browser tabs" seems of limited use.

Focus leave just means the mouse has interacted with something other than your text input. So, changing tab would fire it, but so would selecting another text input, or clicking a button for example

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