ui-components icon indicating copy to clipboard operation
ui-components copied to clipboard

If Drawer has scrolling - clicking an interactive element focuses but doesn't activate

Open ArakTaiRoth opened this issue 8 months ago • 2 comments

Info

Reported by Jenna Granitto

If you create a drawer component with enough content to activate scrolling in it, and you scatter interactive elements throughout it. When you click an interactive element near the top or near the bottom, it will focus on that item (moving the scrollbar as well), which is good, but it doesn't activate that element, you would have to click it again to activate it.

Seen in jam

Acceptance Criteria:

  1. Clicking an interactive element will always focus and activate that element inside the Drawer component

ArakTaiRoth avatar Jul 09 '25 18:07 ArakTaiRoth

This can be fixed by removing the useCapture true value in the focus handler, the removeEventListener will then need to be added.

Image

@vanessatran-ddi Was there a reason the useCapture was used instead of the default event bubbling?

chrisolsen avatar Oct 15 '25 22:10 chrisolsen

This can be fixed by removing the useCapture true value in the focus handler, the removeEventListener will then need to be added.

Image [@vanessatran-ddi](https://github.com/vanessatran-ddi) Was there a reason the `useCapture` was used instead of the default event bubbling?

@chrisolsen I think you were right, remove the useCapture will fix this. I don't remember why we have it at the beginning, but I believe there is no specific reason that we must keep using useCapture

vanessatran-ddi avatar Oct 15 '25 23:10 vanessatran-ddi