# Ui\_text\_input retain last input - tricky to use the widget sometimes

**URL:** https://discourse.nodered.org/t/ui-text-input-retain-last-input-tricky-to-use-the-widget-sometimes/28256
**Category:** Dashboard
**Created:** [12 June 2020 20:27 UTC](https://discourse.nodered.org/t/ui-text-input-retain-last-input-tricky-to-use-the-widget-sometimes/28256 "2020-06-12T20:27:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [12 June 2020 20:27 UTC](https://discourse.nodered.org/t/ui-text-input-retain-last-input-tricky-to-use-the-widget-sometimes/28256/1 "2020-06-12T20:27:36Z")

</div>

I noticed that many Node-RED users get confused with the behaviour of the ui\_text\_input widget and I am not an exception. I am trying to find a solution for the issue below for almost 3 hours now without success.

The flow couldn't possibly be simpler.

 ![a-1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9cdc4d0588b3d9f26e8ad0202863398094fced3e.png)

I want to be able to input a string, a single letter for instance, then clear the input field by pressing the button and then entering the very same letter. The ui\_text\_input widget will not pass the value to the output if it is the same as the previous one.

Try for instance to type the letter "s" (then enter, tab or click somewhere), press the button and enter "s" again.

![a-2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13f9f6da53c9ce1f56f5b709121cb07aeb4eff01.png)

It fails.

![a-3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e83e50939187103d0bb286395c2fec43ebe5201f.png)

I do understand this is the normal behaviour and it is well explained in the help text. However I still need to find a way to enter twice the same value in the widget. For my use case it is mandatory to keep the option `If msg arrives on input, pass through to output `checked.`

I am pretty sure I did use a similar pattern in the past without issues but could not find that flow (or maybe I did not test it thoroughly at that time).

Appreciate any advice.

Edit: forgot to add the flow. Bad day today.

```auto
[{"id":"8cf25508.674348","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"86c37831.cf5ab8","type":"ui_text_input","z":"8cf25508.674348","name":"","label":"Model","tooltip":"","group":"b576f57f.11e4a8","order":2,"width":"4","height":"1","passthru":true,"mode":"text","delay":"0","topic":"","x":630,"y":280,"wires":[["832d22de.a33a7"]]},{"id":"5855ce5a.b96a9","type":"ui_button","z":"8cf25508.674348","name":"Clear","group":"b576f57f.11e4a8","order":2,"width":"4","height":"1","passthru":true,"label":"Clear","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":310,"y":280,"wires":[["b5049be4.54e258"]]},{"id":"386187eb.2f61e8","type":"inject","z":"8cf25508.674348","name":"Empty string","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"0.2","x":170,"y":280,"wires":[["5855ce5a.b96a9"]]},{"id":"832d22de.a33a7","type":"function","z":"8cf25508.674348","name":"node.warn","func":"node.warn(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":280,"wires":[[]]},{"id":"b5049be4.54e258","type":"change","z":"8cf25508.674348","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":280,"wires":[["86c37831.cf5ab8"]]},{"id":"b576f57f.11e4a8","type":"ui_group","z":"","name":"G1","tab":"e9b8050b.d11088","order":1,"disp":false,"width":"4","collapse":false},{"id":"e9b8050b.d11088","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [12 June 2020 21:44 UTC](https://discourse.nodered.org/t/ui-text-input-retain-last-input-tricky-to-use-the-widget-sometimes/28256/2 "2020-06-12T21:44:04Z")

</div>

Unbelievable, it works perfectly when I change the delay from 0 ms to something else. I have no idea why I configured 0 in the first place. I will leave anyway this post here as this may be useful fro someone, some day (perhaps to myself).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [26 June 2020 21:44 UTC](https://discourse.nodered.org/t/ui-text-input-retain-last-input-tricky-to-use-the-widget-sometimes/28256/3 "2020-06-26T21:44:06Z")

</div>

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