# Reset the selected item in dropdown

**URL:** https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885
**Category:** General
**Created:** [7 October 2020 12:59 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885 "2020-10-07T12:59:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![JosephDe](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JosephDe](https://discourse.nodered.org/u/JosephDe)
#### Post date: [7 October 2020 12:59 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/1 "2020-10-07T12:59:12Z")

</div>

I have the following option values in a dropdown ..  
option0 = "None"  
option1 = "A0"  
option2 = "A1"  
option3 = "A2"  
The issue I'm having is when I select an item(ex option2 = "A1") and press a button for process, the value remains selected. I would to have it reset back to option0 = "None".

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [7 October 2020 16:59 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/2 "2020-10-07T16:59:52Z")

</div>

use a change node to set the payload to "option0" and feed it back to the input - probably with a delay so the user gets some feedback - and set the dropdown node to not pass input through

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [8 October 2020 01:35 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/3 "2020-10-08T01:35:16Z")

</div>

If you reselect the same menu item... you do not get the 'selected' property, so it gets tricky to know which item to send back to the drop down (list) to refresh the item. I mentioned this on GitHub that the ui\_list node has this odd quirk that the payload never has the selected item set if you reselect the current menu item.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [8 October 2020 08:33 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/4 "2020-10-08T08:33:21Z")

</div>

no - the issue you had was your option was called "0" which of course hit the javascript falsey scenario so wasn't detected - now fixed.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [8 October 2020 16:34 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/5 "2020-10-08T16:34:44Z")

</div>

Geez... I seem to find all these odd quirks? Just because I happen to have '0' named title? Just my luck! Just the same, thanks for code update. 🙂

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [8 October 2020 16:52 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/6 "2020-10-08T16:52:32Z")

</div>

Thats JavaScript!

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [8 October 2020 21:14 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/7 "2020-10-08T21:14:03Z")

</div>

LOL! So I am learning!

---

<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: [7 December 2020 21:14 UTC](https://discourse.nodered.org/t/reset-the-selected-item-in-dropdown/33885/8 "2020-12-07T21:14:05Z")

</div>

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