# Focus Event not working

**URL:** <https://forum.inductiveautomation.com/t/focus-event-not-working/77845>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 15, 2023, 4:10am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845 "2023-08-15T04:10:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisl](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@chrisl](https://forum.inductiveautomation.com/u/chrisl)\
**Post date:** [August 15, 2023, 4:10am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/1 "2023-08-15T04:10:13Z")

</div>

Hi All, I created a View using coordinate container in my project (version 8.1.26). Then I added a dropdown and button component within a coordinate container. And then I added a onClick event in button as seen below.

 ![tes1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9c0568717861fc7b35261e7dfe8b694495d3ebb7.png)

And then I copied the same View into another project (version  
8.1.18).

Both View should behave the same but in Version 8.1.26, focus() is not working while in 8.1.18, it works properly.

v8.1.26  
 ![8.26](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/f/7fd2763293b463908422c329a3d0fe1a22e25c0b.gif)

v8.1.18  
 ![8.18hj](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c2c5df82eed376da64aed88c9ba7ace6b6cc70d.gif)

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [August 15, 2023, 6:27am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/2 "2023-08-15T06:27:18Z")

</div>

Not sure if it will help in this case. But I would personally move the script to the On Action Performed, as this is the proper button action, rather than clicking on the button object.

---

<div class="post-metadata">

**Author:** ![chrisl](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@chrisl](https://forum.inductiveautomation.com/u/chrisl)\
**Post date:** [August 15, 2023, 6:53am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/3 "2023-08-15T06:53:02Z")

</div>

I tried moving the focus script from onClick to onActionPerformed event but it still wont expand the dropdown content  
 ![pos242](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bc5b60522e656bd9036bf34997129bff9852d8a0.gif)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2023, 5:42pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/4 "2023-08-15T17:42:31Z")

</div>

I can't replicate this "working" in 8.1.18. Could you copy the Coordinate Container node and paste the contents in a formatted snippet within this thread?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2023, 6:49pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/5 "2023-08-15T18:49:04Z")

</div>

After speaking with a Dev, it's not terribly important to replicate at all in 8.1.18 because this was behavior we identified as "undesirable", and you're no longer seeing the behavior you expected because we purposely made the Dropdown send focus to the `<input>` piece of the component as part of 8.1.20 release ([release notes](https://inductiveautomation.com/downloads/releasenotes/8.1.20#:~:text=Fix%20keyboard%20tab%20navigation%20behavior%20of%20dropdown%20and%20numeric%20entry%20field%20components.%20Includes%20many%20more%20improvements%20to%20dropdown%20component%20interactions%20and%20behavior.)). The original behavior (which you see in 8.1.18) would expand the Dropdown, but it is not common practice for Dropdowns to expand their options as they receive focus. In an effort to be more consistent, we no longer expand the options of the Dropdown when it receives focus.

As an exercise, you can examine the behavior of these forums for the expected/traditional behavior.

Click anywhere within the forum which is not a button/link, then press tab until you come to a field which is a dropdown. Note that the dropdown has not expanded, and instead requires you to press SPACE, or Enter/Return to expand the Dropdown.

---

<div class="post-metadata">

**Author:** ![chrisl](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@chrisl](https://forum.inductiveautomation.com/u/chrisl)\
**Post date:** [August 16, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/6 "2023-08-16T00:59:21Z")

</div>

Hi @cmallonee , is there any other way I could expand the dropdown by clicking a sibling button ? TIA

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 16, 2023, 8:39am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/7 "2023-08-16T08:39:47Z")

</div>

did you try turning off the searable feature? as it looks like its trying to type in when you get focus

---

<div class="post-metadata">

**Author:** ![chrisl](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@chrisl](https://forum.inductiveautomation.com/u/chrisl)\
**Post date:** [August 16, 2023, 10:05am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/8 "2023-08-16T10:05:45Z")

</div>

@victordcq , I tried turning off the searchable property, but the dropdown still does not expand (show dropdown options) when I clicked on the sibling button with self.getSibling("Dropdown").focus() event.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 16, 2023, 12:23pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/9 "2023-08-16T12:23:26Z")

</div>

As Cody notes, this is the **correct** behavior. It is not **supposed** to drop down on focus. That it did in the past is a **bug** that got **fixed**.

---

<div class="post-metadata">

**Author:** ![John\_Morgan1](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@John\_Morgan1](https://forum.inductiveautomation.com/u/John_Morgan1)\
**Post date:** [October 10, 2023, 5:52pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/10 "2023-10-10T17:52:58Z")

</div>

so what should I do to make it expanded all the time

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 10, 2023, 6:07pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/11 "2023-10-10T18:07:59Z")

</div>

> [@John\_Morgan1](#):
>
> expanded all the time

Well, then it isn't a drop down at all. Consider using a table with row selection turned on.

---

<div class="post-metadata">

**Author:** ![John\_Morgan1](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@John\_Morgan1](https://forum.inductiveautomation.com/u/John_Morgan1)\
**Post date:** [October 11, 2023, 11:17am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/12 "2023-10-11T11:17:41Z")

</div>

It won't look great. is there is an option like doClick() for button that makes the dropdown menu always expanded

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 11, 2023, 11:57am UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/13 "2023-10-11T11:57:23Z")

</div>

> [@John\_Morgan1](#):
>
> It won't look great.

But at least it will be right and standard GUI. What you're trying to do is just wrong.

Use the table as @pturmel suggested and style the table to look the same as the dropdown.

```auto
enableHeader : false
pager.top : false
pager.bottom : false
rows.striped.enabled : false

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 11, 2023, 12:43pm UTC](https://forum.inductiveautomation.com/t/focus-event-not-working/77845/14 "2023-10-11T12:43:22Z")

</div>

> [@John\_Morgan1](#):
>
> makes the dropdown menu always expanded

Not that I'm aware of. Keep in mind that this would have to be a **browser** feature, as Perspective just tells the browser to display a dropdown. You're really punching a brick wall, here.
