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

Fixed EuiSuperDatePicker input focus. #3154

Merged
merged 15 commits into from
Apr 7, 2020
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ No public interface changes since `22.3.0`.

**Bug Fixes**

- Fixed bug in `EuiSuperDatePicker` that required two clicks to focus input in relative tab ([#3154](https://github.com/elastic/eui/pull/3154))
- Fixed bug in `EuiSuperDatePicker` not showing correct values in relative tab of end date ([#3132](https://github.com/elastic/eui/pull/3132))
- Fixed bug in `EuiSuperDatePicker` to show correct values of commonly used values in relative tab ([#3106](https://github.com/elastic/eui/pull/3106))
- Fixed race condition in `EuiIcon` when switching from dynamically fetched components ([#3118](https://github.com/elastic/eui/pull/3118))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ exports[`EuiTabbedContent behavior when uncontrolled, the selected tab should up
]
}
>
<div
onFocus={[Function]}
>
<EuiTabs>
<div>
<EuiTabs
onFocus={[Function]}
>
<div
className="euiTabs"
onFocus={[Function]}
role="tablist"
>
<EuiTab
Expand Down
12 changes: 6 additions & 6 deletions src/components/tabs/tabbed_content/tabbed_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ export class EuiTabbedContent extends Component<
const { content: selectedTabContent, id: selectedTabId } = selectedTab!;

return (
<div
ref={this.divRef}
className={className}
{...rest}
onFocus={this.initializeFocus}>
<EuiTabs expand={expand} display={display} size={size}>
<div ref={this.divRef} className={className} {...rest}>
cchaos marked this conversation as resolved.
Show resolved Hide resolved
<EuiTabs
expand={expand}
display={display}
size={size}
onFocus={this.initializeFocus}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashikmeerankutty I talked with @chandlerprall and we came to the conclusion that the divRef is still need in order to allow tabbing through all of the tabs. But that it should also be move to <EuiTabs>. By doing so you'll most likely need to modify EuiTabs to forwardRef to the containing div.

Copy link
Contributor Author

@ashikmeerankutty ashikmeerankutty Apr 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cchaos Thanks for the comment. Moved divRef to EuiTabs. Do I need to rename divRef to tabRef for readability?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would help a lot. Perhaps even tabsRef (plural) so it's more obvious that it's on the whole EuiTabs component.

{tabs.map((tab: EuiTabbedContentTab) => {
const {
id,
Expand Down