diff --git a/src-docs/src/views/resizable_container/resizable_container_basic.tsx b/src-docs/src/views/resizable_container/resizable_container_basic.tsx index 473cc533eca..c70d8ba54d8 100644 --- a/src-docs/src/views/resizable_container/resizable_container_basic.tsx +++ b/src-docs/src/views/resizable_container/resizable_container_basic.tsx @@ -14,7 +14,7 @@ export default () => ( {(EuiResizablePanel, EuiResizableButton) => ( <> - +
{text}
Hello world @@ -23,7 +23,7 @@ export default () => ( - + {text} diff --git a/src-docs/src/views/resizable_container/resizable_container_callbacks.tsx b/src-docs/src/views/resizable_container/resizable_container_callbacks.tsx index 24595a755b1..aec980b2ad1 100644 --- a/src-docs/src/views/resizable_container/resizable_container_callbacks.tsx +++ b/src-docs/src/views/resizable_container/resizable_container_callbacks.tsx @@ -78,6 +78,7 @@ export default () => { id={firstPanelId} size={sizes[firstPanelId]} minSize="30%" + tabIndex={0} >
{text}
@@ -91,6 +92,7 @@ export default () => { id={secondPanelId} size={sizes[secondPanelId]} minSize="200px" + tabIndex={0} > {text}
diff --git a/src-docs/src/views/resizable_container/resizable_container_example.js b/src-docs/src/views/resizable_container/resizable_container_example.js index 53b1e247277..982ee91088f 100644 --- a/src-docs/src/views/resizable_container/resizable_container_example.js +++ b/src-docs/src/views/resizable_container/resizable_container_example.js @@ -212,6 +212,17 @@ export const ResizableContainerExample = { EuiResizablePanel component and put the{' '} EuiResizableButton component between.

+ + <> + +

+ Add a prop tabIndex={0} to the{' '} + EuiResizableContainer if it is a fixed height or + has a lot of content. This ensures keyboard users can set focus on + the container and scroll to the bottom using arrow keys. +

+
+
), sections: [ diff --git a/src-docs/src/views/resizable_container/resizable_container_reset_values.tsx b/src-docs/src/views/resizable_container/resizable_container_reset_values.tsx index 97783e35988..7d5ce5ece77 100644 --- a/src-docs/src/views/resizable_container/resizable_container_reset_values.tsx +++ b/src-docs/src/views/resizable_container/resizable_container_reset_values.tsx @@ -93,6 +93,7 @@ export default () => { id={firstPanelId} size={sizes[firstPanelId]} minSize="30%" + tabIndex={0} >
{text}
@@ -105,6 +106,7 @@ export default () => { id={secondPanelId} size={sizes[secondPanelId]} minSize="200px" + tabIndex={0} >
{text}
diff --git a/src-docs/src/views/resizable_container/resizable_container_vertical.tsx b/src-docs/src/views/resizable_container/resizable_container_vertical.tsx index 251889e04e2..1efa8567291 100644 --- a/src-docs/src/views/resizable_container/resizable_container_vertical.tsx +++ b/src-docs/src/views/resizable_container/resizable_container_vertical.tsx @@ -13,7 +13,7 @@ export default () => ( {(EuiResizablePanel, EuiResizableButton) => ( <> - +
{text}
@@ -21,7 +21,7 @@ export default () => ( - +
{text}
diff --git a/src-docs/src/views/resizable_container/resizable_panel_collapsible.tsx b/src-docs/src/views/resizable_container/resizable_panel_collapsible.tsx index 7cd4f67c5eb..8f56491f2ce 100644 --- a/src-docs/src/views/resizable_container/resizable_panel_collapsible.tsx +++ b/src-docs/src/views/resizable_container/resizable_panel_collapsible.tsx @@ -100,7 +100,12 @@ export default () => { - +

{itemSelected.label}

diff --git a/src-docs/src/views/resizable_container/resizable_panel_collapsible_options.tsx b/src-docs/src/views/resizable_container/resizable_panel_collapsible_options.tsx index 2e681ec5237..9a764ff998e 100644 --- a/src-docs/src/views/resizable_container/resizable_panel_collapsible_options.tsx +++ b/src-docs/src/views/resizable_container/resizable_panel_collapsible_options.tsx @@ -66,7 +66,12 @@ export default () => { - +

{itemSelected.label}

diff --git a/src-docs/src/views/resizable_container/resizable_panels.tsx b/src-docs/src/views/resizable_container/resizable_panels.tsx index 0e678c45e08..27a3fda5da5 100644 --- a/src-docs/src/views/resizable_container/resizable_panels.tsx +++ b/src-docs/src/views/resizable_container/resizable_panels.tsx @@ -29,6 +29,7 @@ export default () => ( borderRadius="m" wrapperPadding="m" minSize="20%" + tabIndex={0} >

diff --git a/src/components/resizable_container/__snapshots__/resizable_panel.test.tsx.snap b/src/components/resizable_container/__snapshots__/resizable_panel.test.tsx.snap index f7c68c8c1ae..5aa9524398c 100644 --- a/src/components/resizable_container/__snapshots__/resizable_panel.test.tsx.snap +++ b/src/components/resizable_container/__snapshots__/resizable_panel.test.tsx.snap @@ -1,5 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`EuiResizablePanel props tabIndex 1`] = ` +

+
+
+ Content +
+
+
+`; + exports[`EuiResizablePanel props wrapperPadding 1`] = `
{ expect(container).toMatchSnapshot(); }); + + test('tabIndex', () => { + const { container } = render( + + + Content + + + ); + + expect(container).toMatchSnapshot(); + }); }); }); diff --git a/src/components/resizable_container/resizable_panel.tsx b/src/components/resizable_container/resizable_panel.tsx index e046ff933bb..c419477e35e 100644 --- a/src/components/resizable_container/resizable_panel.tsx +++ b/src/components/resizable_container/resizable_panel.tsx @@ -128,6 +128,10 @@ export interface EuiResizablePanelProps * Custom CSS properties applied to the wrapping `.euiResizablePanel` div */ style?: CSSProperties; + /** + * tabIndex={0} provides full keyboard access when content overflows `` + */ + tabIndex?: number; /** * Props to add to the wrapping `.euiResizablePanel` div */