feat: remove click handler setting onTabContentFocusIn #1263
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OnTabContentFocusIn is used to set a class on the tab to highlight which tab currently has focus so the user knows where any keyboard input or shortcuts used will be applied. This was being set by both focusin and any clicks inside the tab, with clicks triggering an addtional call to focus.
Both handlers were commited at the same time, but I can't think of any reason we were actually setting the focus on click. The click itsellf should do that. My best guess is tabindex=-1 wasn't on the parent at the time (during development as it was also added in the same commit) or maybe browser support at the time? It all came in under one commit.
I have tested in chrome (win & mac), firefox (win) and safari (mac) and clicking on or anywher within any panel (tables, plots, one clicks, console, notebooks, log panel, command history, file exporer) all still set the focus as expected.
Additionally I addressed a firefox edge case around focus and an item being removed from the dom.