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

[EuiPopover] Default to ownFocus #4228

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added `EuiColorPaletteDisplay` component ([#3865](https://github.com/elastic/eui/pull/3865))
- Added `initialFocusedItemIndex` support to `EuiContextMenuPanelDescriptor` ([#4223](https://github.com/elastic/eui/pull/4223))
- Updated the default of the `EuiPopover`s `ownFocus` prop from `false` to `true` ([#4228](https://github.com/elastic/eui/pull/4228))
- Added `role="alert"` and `aria-live="assertive"` to `EuiForm`'s `EuiCallOut` for the errors ([#4238](https://github.com/elastic/eui/pull/4238))
- Added `menuDown` and `menuUp` glyphs to `EuiIcon` ([#4244](https://github.com/elastic/eui/pull/4244))
- Removed spacer after `childrenBetween` in `EuiInMemoryTable` ([#4248](https://github.com/elastic/eui/pull/4248))
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/color_picker/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export default () => {
<EuiFormRow label="Unruly focus management">
<EuiPopover
id="popover"
ownFocus={true}
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/combo_box/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export default () => {

<EuiPopover
id="popover"
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand Down
6 changes: 2 additions & 4 deletions src-docs/src/views/datagrid/control_columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ const SelectionButton = () => {
selected
</EuiButtonEmpty>
}
closePopover={() => setIsPopoverOpen(false)}
ownFocus={true}>
closePopover={() => setIsPopoverOpen(false)}>
<EuiPopoverTitle>
{selectedRows.size} {selectedRows.size > 1 ? 'items' : 'item'}
</EuiPopoverTitle>
Expand Down Expand Up @@ -265,8 +264,7 @@ const trailingControlColumns = [
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
/>
}
closePopover={() => setIsPopoverOpen(false)}
ownFocus={true}>
closePopover={() => setIsPopoverOpen(false)}>
<EuiPopoverTitle>Actions</EuiPopoverTitle>
<div style={{ width: 150 }}>
<button onClick={() => {}} component="span">
Expand Down
3 changes: 1 addition & 2 deletions src-docs/src/views/datagrid/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ const trailingControlColumns = [
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
/>
}
closePopover={() => setIsPopoverOpen(false)}
ownFocus={true}>
closePopover={() => setIsPopoverOpen(false)}>
<EuiPopoverTitle>Actions</EuiPopoverTitle>
<div style={{ width: 150 }}>
<button onClick={() => {}} component="span">
Expand Down
2 changes: 0 additions & 2 deletions src-docs/src/views/expression/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export default () => {
}
isOpen={example1.isOpen}
closePopover={closeExample1}
ownFocus
display="block"
panelPaddingSize="s"
anchorPosition="downLeft">
Expand All @@ -176,7 +175,6 @@ export default () => {
}
isOpen={example2.isOpen}
closePopover={closeExample2}
ownFocus
display="block"
anchorPosition="downLeft">
{renderPopover2()}
Expand Down
2 changes: 0 additions & 2 deletions src-docs/src/views/expression/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export default () => {
}
isOpen={example1.isOpen}
closePopover={closeExample1}
ownFocus
panelPaddingSize="s"
anchorPosition="downLeft">
{renderPopover1()}
Expand All @@ -164,7 +163,6 @@ export default () => {
}
isOpen={example2.isOpen}
closePopover={closeExample2}
ownFocus
anchorPosition="downLeft">
{renderPopover2()}
</EuiPopover>
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/filter_group/filter_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default () => {
</EuiFilterButton>
<EuiPopover
id="popover"
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/filter_group/filter_group_multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export default () => {
<EuiFilterGroup>
<EuiPopover
id="popoverExampleMultiSelect"
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
2 changes: 0 additions & 2 deletions src-docs/src/views/form_layouts/inline_popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export default () => {
<div>
<EuiPopover
id="inlineFormPopover"
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand All @@ -121,7 +120,6 @@ export default () => {
&emsp;
<EuiPopover
id="formPopover"
ownFocus
button={button2}
isOpen={isPopover2Open}
closePopover={closePopover2}>
Expand Down
3 changes: 0 additions & 3 deletions src-docs/src/views/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ const HeaderUserMenu = () => {
return (
<EuiPopover
id={id}
ownFocus
button={button}
isOpen={isOpen}
anchorPosition="downRight"
Expand Down Expand Up @@ -286,7 +285,6 @@ const HeaderSpacesMenu = () => {
return (
<EuiPopover
id={id}
ownFocus
button={button}
isOpen={isOpen}
anchorPosition="downLeft"
Expand Down Expand Up @@ -358,7 +356,6 @@ const HeaderAppMenu = () => {
return (
<EuiPopover
id={popoverId}
ownFocus
button={button}
isOpen={isOpen}
anchorPosition="downRight"
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/header/header_alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ const HeaderUserMenu = () => {
return (
<EuiPopover
id={id}
ownFocus
repositionOnScroll
button={button}
isOpen={isOpen}
Expand Down
3 changes: 0 additions & 3 deletions src-docs/src/views/header/header_elastic_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export default ({ theme }) => {
const userMenu = (
<EuiPopover
id="guideHeaderUserMenuExample"
ownFocus
repositionOnScroll
button={
<EuiHeaderSectionItemButton
Expand Down Expand Up @@ -181,7 +180,6 @@ export default ({ theme }) => {
const spacesMenu = (
<EuiPopover
id="guideHeaderSpacesMenuExample"
ownFocus
repositionOnScroll
button={
<EuiHeaderSectionItemButton
Expand Down Expand Up @@ -217,7 +215,6 @@ export default ({ theme }) => {
const deploymentMenu = (
<EuiPopover
id="guideHeaderDeploymentMenuExample"
ownFocus
repositionOnScroll
button={
<EuiBadge
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default () => {

return (
<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand Down
12 changes: 0 additions & 12 deletions src-docs/src/views/popover/popover_anchor_position.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default () => {
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -104,7 +103,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -122,7 +120,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -144,7 +141,6 @@ export default () => {
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -162,7 +158,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -180,7 +175,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -202,7 +196,6 @@ export default () => {
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -220,7 +213,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -238,7 +230,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -260,7 +251,6 @@ export default () => {
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -278,7 +268,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand All @@ -296,7 +285,6 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover_block.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default () => {

return (
<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default () => {
return (
<EuiPanel panelRef={setPanelRef}>
<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
9 changes: 1 addition & 8 deletions src-docs/src/views/popover/popover_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,21 @@ const inputPopoverSource = require('!!raw-loader!./input_popover');
const inputPopoverHtml = renderToHtml(PopoverBlock);

const popOverSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
<!-- Popover content -->
</EuiPopover>`;

const trapFocusSnippet = `<EuiPopover
ownFocus={false}
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
<!-- Popover content -->
</EuiPopover>`;

const popoverAnchorSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand All @@ -83,7 +82,6 @@ const popoverAnchorSnippet = `<EuiPopover
</EuiPopover>`;

const popoverWithTitleSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand All @@ -93,7 +91,6 @@ const popoverWithTitleSnippet = `<EuiPopover
</EuiPopover>`;

const popoverPanelClassNameSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand All @@ -103,7 +100,6 @@ const popoverPanelClassNameSnippet = `<EuiPopover
</EuiPopover>`;

const popoverWithTitlePaddingSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand All @@ -114,7 +110,6 @@ const popoverWithTitlePaddingSnippet = `<EuiPopover
</EuiPopover>`;

const popoverContainerSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand All @@ -123,7 +118,6 @@ const popoverContainerSnippet = `<EuiPopover
</EuiPopover>`;

const popoverFixedSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand All @@ -132,7 +126,6 @@ const popoverFixedSnippet = `<EuiPopover
</EuiPopover>`;

const popoverBlockSnippet = `<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover_fixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default () => {
<EuiButton onClick={toggleExample}>Toggle example</EuiButton>
{isExampleShown && (
<EuiPopover
ownFocus
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover_htmlelement_anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const PopoverApp = (props) => {

return (
<EuiWrappingPopover
ownFocus
button={props.anchor}
isOpen={isPopoverOpen}
closePopover={closePopover}>
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/popover/popover_panel_class_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default () => {

return (
<EuiPopover
ownFocus
button={
<EuiButton
iconType="arrowDown"
Expand Down
Loading