If Drawer has scrolling - clicking an interactive element focuses but doesn't activate
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:
- Clicking an interactive element will always focus and activate that element inside the Drawer component
This can be fixed by removing the useCapture true value in the focus handler, the removeEventListener will then need to be added.
@vanessatran-ddi Was there a reason the useCapture was used instead of the default event bubbling?
This can be fixed by removing the
useCapturetruevalue in thefocushandler, theremoveEventListenerwill then need to be added.[@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](https://github.com/vanessatran-ddi) Was there a reason the `useCapture` was used instead of the default event bubbling?