Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbar activeIndex does not update when clicking on a nested element within the toolbar #6819

Closed
mollykreis opened this issue Aug 21, 2023 · 0 comments · Fixed by #6830
Closed
Labels
status:triage New Issue - needs triage

Comments

@mollykreis
Copy link
Contributor

🐛 Bug Report

With the FAST toolbar, the activeIndex represents which element within the toolbar should have focus when the toolbar is focused. That index is updated when an element within the toolbar is clicked. However, the click handler does not account for a nested item being clicked.

For example, if a div exists inside of a button within the toolbar, and that div is clicked, the click handler doesn't recognize the button as being the new focused element.

💻 Repro or Code Sample

Simple reproducing example:
https://typescript-9zx3yc.stackblitz.io

🤔 Expected Behavior

Clicking any part of, or any element within, an element slotted within the toolbar should cause the activeIndex to update to the index of that element.

😯 Current Behavior

The activeIndex of the toolbar only updates if an element slotted within the toolbar is clicked, not a nested element within it.

💁 Possible Solution

Update the toolbar's clickHandler to check for the click target being contained within one of the focusableElements of the toolbar rather than being one of the focusableElements of the toolbar.

See the existing clickHandler code here

🔦 Context

🌍 Your Environment

  • OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
  • Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
  • Version [e.g. 1.8.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:triage New Issue - needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant