feat: remove click handler setting onTabContentFocusIn#1263
Merged
Conversation
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.
Codecov Report
@@ Coverage Diff @@
## main #1263 +/- ##
==========================================
- Coverage 45.57% 45.37% -0.21%
==========================================
Files 486 502 +16
Lines 34101 34666 +565
Branches 8538 8675 +137
==========================================
+ Hits 15543 15728 +185
- Misses 18507 18887 +380
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more. |
bmingles
previously approved these changes
May 4, 2023
Contributor
bmingles
left a comment
There was a problem hiding this comment.
Changes look good to me
mofojed
requested changes
May 4, 2023
mofojed
approved these changes
May 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.