# \[IGN-6521\]Unable to Search Through Vision Dropdown Component with Keystrokes

**URL:** <https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [August 12, 2022, 5:43pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964 "2022-08-12T17:43:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Nayback](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Benjamin\_Nayback](https://forum.inductiveautomation.com/u/Benjamin_Nayback)\
**Post date:** [August 12, 2022, 5:43pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/1 "2022-08-12T17:43:54Z")

</div>

Hey all,

I have two Gateway servers currently (8.1.15 and 8.1.18) and the problem I am experiencing is with 8.1.18. I am unsure if something with the component in the backend has changed, but I am no longer able to search through a dropdown list by typing like I was able to in 8.1.15:

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f73e4f20d817d3b947f3019002a39ab7c6caac9b.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f73e4f20d817d3b947f3019002a39ab7c6caac9b.mp4)

I typed ‘0904’ and I was able to instantly select the item. Same thing with ‘0906’

8.1.18:

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e034b8798841b120ba1c82a21df837a64811c74.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e034b8798841b120ba1c82a21df837a64811c74.mp4)

I tried the same thing as above, and it only scrolled down when I typed a number or letter that those items began with. All the items began with a ‘0’, so everytime I hit a ‘0’, it scrolled down one item instead of trying to find an item with the list of characters I typed.

I am not sure if this is a bug or a feature that has changed, either way, I think it would be kind of redundant to program a script for every single dropdown component I have (50-100 in one project out of ~10 projects).

Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 12, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/2 "2022-08-12T18:04:50Z")

</div>

The ‘search like’ functionality was deliberately removed because it was buggy (in particular, typing a space would ‘reset’ the search buffer, leading to unexpected results). However, you’re not the first person to complain, so we may end up reverting that change and accepting the occasionally buggy behavior.

For context, the `KeySelectionManager` that drives this logic is very deliberately written to only allow single-character selection, not searching based on a buffer: [JComboBox.KeySelectionManager (Java SE 11 & JDK 11 )](https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/JComboBox.KeySelectionManager.html)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Nayback](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Benjamin\_Nayback](https://forum.inductiveautomation.com/u/Benjamin_Nayback)\
**Post date:** [August 12, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/3 "2022-08-12T18:15:21Z")

</div>

Ahhh I see; that would explain everything. Maybe have a property to enable/disable ‘search like’? I am sure there are some who don’t necessarily need this functionality, but then on the flip side there are those who have huge lists of data and would benefit from a feature like this.

Anyways, thank you for the quick response so I didn’t go down a rabbit hole trying to solve this!

---

<div class="post-metadata">

**Author:** ![NGBDana](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@NGBDana](https://forum.inductiveautomation.com/u/NGBDana)\
**Post date:** [August 25, 2022, 2:10pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/4 "2022-08-25T14:10:35Z")

</div>

Hi there,  
Since upgrading from version 7.9. I have had many users ask about this topic. We have many vision dropdowns where this ‘search like’ feature worked great for my users to be more efficient at entering data. I would really like to see this feature come back in some form.

Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 26, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/5 "2022-08-26T15:43:47Z")

</div>

I’ve created an internal ticket (you two aren’t the first who’ve asked) to see if we can revert to the original behavior without some of the other drawbacks that caused it to change in the first place.

---

<div class="post-metadata">

**Author:** ![anthony.urquizo](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@anthony.urquizo](https://forum.inductiveautomation.com/u/anthony.urquizo)\
**Post date:** [November 24, 2022, 8:33pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/6 "2022-11-24T20:33:32Z")

</div>

Is there any update or estimated time on this request?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 25, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/7 "2022-11-25T19:13:32Z")

</div>

The revert was done recently; I'm not sure the exact version but I believe 8.1.23 will have it; possibly 8.1.22.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 15, 2023, 12:05pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/8 "2023-03-15T12:05:41Z")

</div>

@paul-griffith whether this issue fixed in 8.1.23?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 16, 2023, 2:09am UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/9 "2023-03-16T02:09:19Z")

</div>

> [@prasath.t](#):
>
> this issue fixed in 8.1.23

It's back and as far as I can tell, it is behaving the same as before.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 18, 2023, 4:06am UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/10 "2023-03-18T04:06:43Z")

</div>

This seemed like an interesting problem, and I had the night off, so I fiddled around with this and developed a prototype searchable combo box:

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4b3cd52f704eee4ed73efb47c9343bfa82871854.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4b3cd52f704eee4ed73efb47c9343bfa82871854.mp4)

**Version 2 with auto complete and preview selections options enabled and auto resize behavior disabled:**

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/7349f692e499695cd56f2f339ff41b7aa20112c1.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/7349f692e499695cd56f2f339ff41b7aa20112c1.mp4)

While I was at it, I made all of the colors for the dropdown, textbox, and button all independently accessible:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/a/fa8fc6621ba9f09c1d2791cfe3920fb4542374d5.png)

I also added a maxRow property that makes the number of rows displayed variable:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6ad57108d9afab3769825bf1dc6d697f46ff4f9d.png)

...and the width of the dropdown automatically adjusts to the width of the text

Just in case anybody else wants to play around with this and develop it further, here is the working prototype:  
[~~prototypeSearchableDropdown.zip|attachment~~](https://forum.inductiveautomation.com/uploads/short-url/kJK9SLZMk1WeQfBD7lpeYNIquNl.zip) (7.2 KB)  
[~~searchableDropdown\_v1.014.zip~~ |attachment](https://forum.inductiveautomation.com/uploads/short-url/zR0ANM852mEGaeIr13Tp2jTOsE9.zip) (7.6 KB)  
[~~searchableDropdown\_v1.019.zip~~ |attachment](https://forum.inductiveautomation.com/uploads/short-url/savtIWInNY7jksXmkKCRcs1XOKL.zip) (8.6 KB)  
[~~searchableDropdown\_v2.0.zip~~ |attachment](https://forum.inductiveautomation.com/uploads/short-url/zIx99AJIYj0NdEnSSl9zTlA9VfT.zip) (9.9 KB)  
[~~searchableDropdown\_v2.01.zip|attachment~~](https://forum.inductiveautomation.com/uploads/short-url/xJOeHHyj0J5WkNHwaPrdFXaVL7o.zip) (10.0 KB)  
See [the current exchange version](https://www.inductiveautomation.com/exchange/2472) for all future updates

**Update: v1.014**  
• Added support for all datatypes  
• Restructured code, so the dropdown will populate and function no matter how many columns are present  
• Corrected focus issue that would occasionally cause the first letter to be deleted when typing  
• Improved data validation, so if the text is edited, and it no longer exactly matches a dropdown selection, the selected index and selected values get set to -1 and the selected label gets set to None  
• added clearTextOnClick option that, if selected, will automatically clear the text from text field when the component is initially clicked on.  
• Set the minimum width of the dropdown menu to the width of the dropdown itself. The dropdown menu will still automatically widen if the text is wider than the component, but if it runs out of room, a horizontal script will appear.  
**Update: v1.019**  
• Added autocomplete option  
**Update: v2.000**  
• Added up arrow, down arrow, page up, and page down functionality  
• Refactored code for improved efficiency  
• Added mouse listener to dropdown to highlight the item the mouse is hovering over  
• Added custom properties for changing the foreground and background colors of the selected row in the dropdown  
• Added preview selection function  
**Update: v2.001**  
• Added escape key functionality to close the dropdown window  
• Added an auto resize option that when selected causes the dropdown menu to remove whitespace from the dropdown whenever the number of selectable rows are less than the maxRows parameter.  
• This version has been [published on the exchange](https://www.inductiveautomation.com/exchange/2472).  
[**Updates v2.02 and v2.03**](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/16)

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 21, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/11 "2023-03-21T15:08:13Z")

</div>

Are you using any project library script?

Its missing in your zip file you have attached

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 21, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/12 "2023-03-21T15:26:55Z")

</div>

No; everything is self contained, and I've imported the template and tested it on multiple systems, but that said, I'm sure there is a lot of room for further development.

Are you getting some kind of error?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 21, 2023, 3:34pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/13 "2023-03-21T15:34:15Z")

</div>

yes getting error

tested in ignition 8.1.17

passed dataset

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70a3e40920498ecde83b2f355f29ac111a38614e.png)

error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/7/87678cfb514dd595b433c61cc5c7a5df29e15385.png)

whether i missing something?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 21, 2023, 3:39pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/14 "2023-03-21T15:39:39Z")

</div>

~~Yes. The way this dropdown is designed, it requires two columns: Value and Label. Value is an integer, and Label is a string. If you need it to work in some other way, the script will need further development.~~

The core script is a custom method on the text field component.

**Edit:** The above statement is no longer true. [See update notes](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/10)

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 21, 2023, 4:51pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/15 "2023-03-21T16:51:13Z")

</div>

Oh ok fine.. thanks for the input

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [May 4, 2023, 7:28pm UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/16 "2023-05-04T19:28:57Z")

</div>

The searchable dropdown component that was originally prototyped [here](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/10) has been further developed and published on the exchange:

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2472)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

**Features that have been added that were not present in the original prototype:**

- Added support for all datatypes
- Restructured code to populate and function properly no matter how many columns are present
- Corrected focus issue that could delete the first letter when typing
- Improved data validation to reset selected index and values if edited text no longer matches a dropdown selection
- Added clearTextOnClick option so the clear text field on click is optional
- Set minimum dropdown menu width to width of the dropdown component
- Added autocomplete option
- Added up/down arrow, page up/down, escape, and enter key functionality within the dropdown menu itself
- Refactored code so the dropdown menu component is not recreated every time the user types
- Added mouse listener to highlight dropdown item on hover
- Added custom properties to change selected row foreground/background colors
- Added preview selection function
- Added auto resize option to automatically remove whitespace in dropdown menu when the list is shortened by filtering

**Version 2.02 Improvements:**  
• Changed the way strings are handled, so special Unicode characters and Unicode characters from other languages can now be displayed and searched for in the dropdown. **Example:** áéíóúÁÉÍÓÚñÑ  
• Corrected a bug that appeared when there is only a single column of string data, so the selected value does not become the row index of the filtered data rather than the selected index of the entire dataset  
• Refactored code adding a setSelectedValues custom method to eliminate a point of redundancy that was discovered  
• Added automatic integer conversion to string values in the value column if the string values are numeric  
• Added a selectedStringValue property, so that unconvertable non-numeric value column selections can be represented by a externally accessible property

**Version 2.03 Improvements:**  
**(Improvements based on user feedback and implementations)**  
• When writing to the selected index, label, value, or string value properties, the system will automatically update all relevant elements, assuming that the provided information is a valid member of the dataset. If the information is not valid, the attempted write operation will be removed.  
**Example:** Writing a value of 6 to the selectedIndex property will automatically update the selectedLabel, selectedValue, selectedStringValue, and the actual text that is typed in the dropdown (if there is an entry at index 6 in the primary dataset).

• While typing, the moment the text matches a label in the dataset, the selected label and associated properties will update accordingly without the need for further input.  
• In previous versions, _changing the data in the designer_ _ **while not in preview mode** _ could result in either an index out of bounds exception at run time or the selected value being displayed in the textfield instead of the selected label. This could only happen if the number of columns changed to less than two or to greater than one. The list click listener was updated, so it determines the label index at the mouse click event instead of at its initialization.  
• Refactored and corrected regression in passFocus custom method that allowed the dropdown button to gain focus when tabbing  
• Added keyPressed and keyReleased custom properties that receive the keyCode from the text field's keyPressed and keyReleased events. They will fire a propertyChange event every time a key is pressed or released making it possible to do custom key event scripting from a specific template instance without having to add a listener at run time  
• Added clearSelectionsOnDataChange option that makes clearing the selected values, label, and text optional any time that the dataset for the dropdown is replaced via binding or scripting. In other words, if this option is deslected, and the Data property for the dropdown is updated, the selected label, values, and index will properties at the time of the update will remain unchanged  
• Dropdown font matches the textfield font, and automatically scales with the the textfield font when the searchable dropdown component is resized.  
• Added the option to highlight text automatically on focus gained

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 12, 2023, 7:11am UTC](https://forum.inductiveautomation.com/t/ign-6521-unable-to-search-through-vision-dropdown-component-with-keystrokes/62964/17 "2023-10-12T07:11:56Z")

</div>

**Update: Version 3.00 Improvements:**  
• A searchable table mode was added that shows all columns to the right of the value column inside the dropdown menu  
• The column widths automatically size to the text within the columns or proportionally adjust up to an adjustable max width property.  
• Showing the table header is individually selectable, and both the header color as well as the header text colors are individually selectable.  
• In cases where the value label columns are not unique, but other columns are, the dropdown now has the ability to differentiate selection based on the additional data columns regardless of whether or not it is in table mode.  
• The predictive text feature now starts predicting on the very first character instead of the second.

**Update: [Version 3.01](https://inductiveautomation.com/exchange/2472/overview):**  
**New Properties:**

- `alignHorizontalLeft`
- `alignHorizontalRight`
- `downArrowAutoScale`
- `fontBold`
- `fontFixedSizeEnable`
- `fontFixedSize`
- `fontItalic`

**Bug Fixes:**

- Fixed an issue where the down arrow icon would turn into an ellipsis when the searchable dropdown was resized too small.
- Resolved a bug that prevented selected fields from being written to immediately after the data property changed during initialization.
- Added a missing break in the text prediction loop, so the predicted [auto complete] text is now the first item in the list instead of the last while typing

**Updates:**

- Removed horizontal font scaling. Users can now create narrow instances of the dropdown without the text appearing too small. The auto font scaling will now solely depend on the dropdown's vertical size.

**Detailed Property Descriptions:**

**Alignment Properties:**

- `alignHorizontalLeft`: When set to `True` and `alignHorizontalRight` is `False`, it aligns all text to the LEFT.
- `alignHorizontalRight`: When set to `True` and `alignHorizontalLeft` is `False`, it aligns all text to the RIGHT.
- `alignHorizontalLeft & alignHorizontalRight`: If both are set to `True`, text is aligned CENTER. If both are `False`, `alignHorizontalLeft` is set as the default at runtime.

**Note:** Alignment properties affect both the text field and the dropdown.

**Font Properties:**

- `fontBold` and `fontItalic`: Enables BOLD and/or ITALIC font styles for the text in both the text field and the dropdown.
- `fontFixedSizeEnable`: Disables font scaling and enforces the use of the fixed font size.

**Button Icon Scaling:**

- `downArrowAutoScale`: When enabled, the down arrow icon size scales with the button at runtime. If set to `False`, the down arrow maintains a fixed size.
