-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiPopover] Default to ownFocus #4228
[EuiPopover] Default to ownFocus #4228
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
I think the only one we don't want
Is this a limitation of the test or is this a bug in |
@cchaos, I changed the This is the error of the test once the But @chandlerprall is taking a look. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
Dug in, when Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this all makes sense. I couldn't think of another EUI component that would want this to default to false besides EuiTour. 👍
Just had one comment about the tests.
Co-authored-by: Caroline Horn <[email protected]>
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
[Michail is out until Wednesday, should be able to get his review then] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this PR. Good to merge as is for sure. I hate opening this issue across all of Kibana.
The one thing I'd add, though could be fine as its own ticket as well, is to change the color_picker default to true
instead of false
as well.
Resolved the conflict & am merging this to include it in the release |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4228/ |
This reverts commit da291a1.
* Defaulting to ownfocus * Defaulting ownFocus to true * Trap focus example * Removing ownFocus prop * Adding CL * Test for default ownFocus and tour step popover ownFocus changed to false. * Update src-docs/src/views/popover/popover_example.js Co-authored-by: Caroline Horn <[email protected]> * Fixing tests Co-authored-by: Caroline Horn <[email protected]> Co-authored-by: Chandler Prall <[email protected]>
Summary
Closes #4222.
In this PR I'm changing the default of the EuiPopover
ownFocus
prop fromfalse
totrue
.Components without the
ownFocus
propAll of the following files didn't have a
ownFocus
prop. So by default theownFocus
wasfalse
. So by replacing the default withtrue
all of these components changed toownFocus=true
. I’m assuming that this change is ok and a good improvement for all theEuiPopover
’s inside the following files:src/components/tour/tour_step.tsxChanged toownFocus={false}
. As mentioned by @cchaos, we want the user to be able to interact with other parts of the UI while this popover is openComponents managing their
ownFocus
For the following files I didn’t change anything because they have their own way to manage the
ownFocus
:ownFocus={popoverShouldOwnFocus}
ownFocus={isPopoverOpen}
ownFocus={isFocused}
ownFocus={false}
ownFocus={false}
ownFocus={!!popoverTrigger}
Components with the
ownFocus
propI also searched for components which had the
ownFocus
prop (true
). Now that theownFocus
by default is true I removed the prop:Tests
All the tests in
src/components/popover/popover.test.tsx
didn’t have theownFocus
prop. It means theownFocus
was set tofalse
. I left the components without the prop. So it means theownFocus
now istrue
.ownFocus
prop to false |closePopover is called when ESC key is hit and the popover is open
I also add theChanged the test title toownFocus={false}
to the testownFocus defaults to false
ownFocus defaults to true
and removed the prop. As mentioned by @chandlerprall, this keeps with the original intent of the test to verify the default valueChecklist
[ ] Check against all themes for compatibility in both light and dark modes[ ] Checked in mobile[ ] Added documentation[ ] Checked Code Sandbox works for the any docs examples[ ] Checked for breaking changes and labeled appropriately