# Plug in drop down is not working

**URL:** <https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [September 8, 2019, 9:45pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228 "2019-09-08T21:45:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlene](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/marlene/32/523_2.png) [@marlene](https://forums.creativeclouddeveloper.com/u/marlene)\
**Post date:** [September 8, 2019, 9:45pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/1 "2019-09-08T21:45:34Z")

</div>

My plugin drop-down stopped working this week. Is anyone else experiencing similar issues?

I have a drop-down that allows me to reorder items. When I use the dropdown, the items do re-order, but the number in the item remains the same. I don’t know how to fix this or what is wrong with it. What can I do? Please advise!

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [September 9, 2019, 10:16am UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/2 "2019-09-09T10:16:37Z")

</div>

May I ask on which platform (Windows or macOS) and in which version of XD, you’re experiencing this issue?

Furthermore, how does (or should) your drop-down allow for reordering items? This sounds like something custom (a standard `<select>` element wouldn’t allow for reordering items, as far as I know), meaning we’ll probably need to see some sort of code (of course, not necessarily the whole plugin, but the relevant sections) in order to help…

Thank you very much in advance 🙂👍

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [September 9, 2019, 2:46pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/3 "2019-09-09T14:46:43Z")

</div>

Any code, snippets, screenshots, and recordings you have would also be useful! 🙂

---

<div class="post-metadata">

**Author:** ![marlene](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/marlene/32/523_2.png) [@marlene](https://forums.creativeclouddeveloper.com/u/marlene)\
**Post date:** [September 9, 2019, 5:53pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/4 "2019-09-09T17:53:19Z")

</div>

version 22.1.12.5

MAC

```auto
 <select value={i} onChange={(e)=> props.onChange(e, role)}>
          {Array(total).fill(0).map((item, i)=> {
            return (<option key={i} value={i}>{i + 1}</option>);
          })}
        </select>

```

````auto
          <div className="">
            {landmark.roles.map((role, i) => {
              return (
                <LandmarkField
                  key={i}
                  role={role}
                  i={i}
                  total={landmark.roles.length}
                  onChange={props.onTabChange}
                  onDelete={() => props.onDelete(role)}
                />
              );
            })}
          </div>```
````

---

<div class="post-metadata">

**Author:** ![marlene](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/marlene/32/523_2.png) [@marlene](https://forums.creativeclouddeveloper.com/u/marlene)\
**Post date:** [September 9, 2019, 6:18pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/5 "2019-09-09T18:18:44Z")

</div>

![ally%20dropdown%20](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/1X/a2e59b92a1bd9b6f1839734ce6abaf86d7939927.gif)

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [September 9, 2019, 6:29pm UTC](https://forums.creativeclouddeveloper.com/t/plug-in-drop-down-is-not-working/1228/6 "2019-09-09T18:29:57Z")

</div>

I think that one thing that could be problematic here (although I’m not sure if it’ll fix the problem) is having the `key` be the index. As React (to my understanding) checks whether the DOM has to get updated based on the question if the element has changed (i.e., here, if the key has changed), having the key stay the same (the fourth element will still have `3` as its key) could lead to React determining that it doesn’t have to update this aspect of the DOM, leaving it in the state as shown by your screenshot. In general, though, having the index as a key isn’t necessarily a good idea when you can manipulate items (as it basically defeats the purpose of it).

Could you try to change the `key` to something different, e.g., a `JSON.stringify` version of `role` and `item` (or, for testing, leave it out), and report what happens?
