Bug: ui-text-input : trigger on Focus Leave after Enter

When entering input and pressing the Enter, the input is sent to start a flow. All good..
However, when clicking outside the input field after the initial input has been sent, the same input is sent again (triggering the flow for a second time).

Expected behaviour: after pressing enter to send an input, clicking outside the input field should not send the input again.

Workaround 1 : disabling send message on Focus Leave
Workaround 2 : clearing the input by sending an empty string

Are you talking about the new flowfuse dashboard @flowfuse/node-red-dashboard?
If so then I see that too. The best thing is to report an issue at Issues · FlowFuse/node-red-dashboard · GitHub.
Post a link to the issue back here and I will add a comment to it.

For flowfuse dashboard queries here you should add the tag dashboard-2 to the post then the D2 people will see it. I will add that for you.

In the meantime, add an RBE (filter) node after the input, then you'll only get a value when it's changed.

omg.. what was I thinking.. this should indeed be a github issue..
i'll create one later today, this should receive no further attention here..

Just to confirm, this is not a bug, but by design. I had originally built in a feature that didn't send the same message twice, but community feedback was this shouldn't be the case, see discussion here: Text Input Node not sending msg.payload on focus leave (0.10.2 bug / regression) · Issue #442 · FlowFuse/node-red-dashboard · GitHub

As such, it was agreed that if a user has ticked the box "Send on focus leave" then the messages will always be sent with a focus-leave event, rather than us trying to be "smart" about it.

If you only want an input to be triggered with an <enter> press, then untick the other options, as per "Workaround 1" detailed.

2 Likes

Sorry, but I shouldn't need to. An input node should not send the same data twice just because a user decides to click somewhere else on a page after the input has already been sent. Not unless the input data has changed.

Hmm.. strange discussion.. and illogical uix behaviour.
For now I'll use the workaround and forego the github issue.

Thanks! :slight_smile:

But if you have explicitly defined that the node should send a message of focus leave and on-enter, then that's what the node should do?

Well.. and is not explicitly defined in the UI node settings:

image

Nor is there any help text to define this.
And so... not necessarily. For me as Dashboard node user, I'm reading this as meaning either-or. And imho that is also the expected behaviour of an interface user: either press enter or click outside the field to enter the data.

Use case: I have one text input field where a user is entering his\her account info. That is the only info I need. Since the user is already typing it makes sense that they will press Enter to start the flow. So far so good. But there are people who like to click somewhere on a page instead of pressing Enter, so I also want to start the flow if the user for some reason does not press enter but chooses to click outside the input box if they so desire. Great, I have an option for that in the ui-input-node.
So.. now if I have a user who presses enter and thereby starts the flow, and after that clicks on the page for some reason (boredom, impatient, playing around, ...), the flow is now started a second time, with the same input information.

Sure, I can do things in the flow to counteract that. But my point is that I shouldn't have to. Not unless the user input changes.
As said above: to me, it just makes no sense at all to send the same data again just because the user decides to click somewhere else on a page after the user input has already been sent out (after either a keyboard Enter or a click outside the input field). The input field should loose focus after an Enter.

But again, it's not that big of a deal, there are ways around this. :slight_smile:

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