# Select from dropdown by pressing enter

**URL:** <https://forum.inductiveautomation.com/t/select-from-dropdown-by-pressing-enter/103139>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [March 3, 2025, 12:55pm UTC](https://forum.inductiveautomation.com/t/select-from-dropdown-by-pressing-enter/103139 "2025-03-03T12:55:40Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jfogt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jfogt/32/76986_2.png) [@jfogt](https://forum.inductiveautomation.com/u/jfogt)\
**Post date:** [July 1, 2025, 3:40pm UTC](https://forum.inductiveautomation.com/t/select-from-dropdown-by-pressing-enter/103139/5 "2025-07-01T15:40:02Z")

</div>

Hello,

I was having the same issue and created a fix that allows users to press **Enter** and select the top option in the list. It is a little lengthy, but not completely impractical if the **Enter** functionality is a must.

 ![Dropdown.props](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/de7d7dbcb8c71de01f4e46a54a02b887e0ede500.png)

I first bound a newly created `options_trimmed` to my dropdown `options`. The expression filters the dataset using the `this.props.search.searchparam`, matching by leading text in this case. The `view()` expression comes from @pturmel's Integration Toolkit.

 ![options_trimmed expression binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29c087d69750140542d25c8bd2693b8f48ec1994.png)

Then I created a custom property, `dd1options`, that is bound to the top value in the `options_trimmed` dataset. Inspiration comes from this [post](https://forum.inductiveautomation.com/t/perspective-dropdown-how-to-default-to-the-first-value/75285/3?).

 ![dd1options binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c17e40b7393e3e6fc4e84062b4f1982d6c43a01e.png)

After that, I just configured a new **onKeyDown** script for the Dropdown component, leaving **Prevent Default** unchecked.

```python
# if enter is pressed the top result will be selected
	if event.key == 'Enter':
		self.props.value = self.custom.dd1options
		self.focus()

```

I'm sure this is not the best or most efficient method but figured I should put it out there for anybody interested.

---

_[View the full topic](https://forum.inductiveautomation.com/t/select-from-dropdown-by-pressing-enter/103139)._
