Added autoFocus
option to EuiTabbedContent
#2062
Merged
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.
The focus state of EuiTabs can confuse users since it's so prominent compared to the selected state. Some users thing the focus state is the selected state. This PR attempts to allow setting the initial focus of the tabbed items from
initial
(first tab) toselected
(selected tab).There are 2 issues with it at the moment:
[ ] 1. If the selected tab is not the first, users have to shift + tab in order to get to the previous tabs.Got confirmation from most that this is not an issue.document.getElementById()
to find the selected tab, which probably isn't greatstate.focus
totrue
and then auto focuses on the selected tab. The problem is that I have to reset the state tofalse
when a user tabs out of the control. However, it seems to cycle asblur then focus
each tab press.Also fixes the second action item for the EuiDatePicker from GAH:
Checklist
[ ] This was checked in mobile[ ] This was checked in dark mode[ ] This was checked for breaking changes and labeled appropriately[ ] This required updates to Framer X components