diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a16f85622..8b401a4b7f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `0.0.52`. +**Bug fixes** + +- Added `role="dialog"` to `EuiFlyout` to improve screen reader accessibility ([#916](https://github.com/elastic/eui/pull/916)) ## [`0.0.52`](https://github.com/elastic/eui/tree/v0.0.52) diff --git a/src-docs/src/views/flyout/flyout.js b/src-docs/src/views/flyout/flyout.js index e430b767464..0922eec6e30 100644 --- a/src-docs/src/views/flyout/flyout.js +++ b/src-docs/src/views/flyout/flyout.js @@ -37,16 +37,24 @@ export class Flyout extends Component { } render() { - let flyout; + if (this.state.isFlyoutVisible) { flyout = ( -

You can use ESC to close this panel, but we could also pass in a close button like so.

+

+ A flyout +

+ +

+ You can use ESC to close this panel, but we could also pass in a close button like so. +

); } + return (
diff --git a/src-docs/src/views/flyout/flyout_complicated.js b/src-docs/src/views/flyout/flyout_complicated.js index 39c7fb70481..d7fc89ecf35 100644 --- a/src-docs/src/views/flyout/flyout_complicated.js +++ b/src-docs/src/views/flyout/flyout_complicated.js @@ -139,16 +139,18 @@ export class FlyoutComplicated extends Component { flyout = ( -

+

Flyout header

- +

Put navigation items in the header, and cross tab actions in a footer.

@@ -184,6 +186,7 @@ export class FlyoutComplicated extends Component {
); } + return (
diff --git a/src-docs/src/views/flyout/flyout_example.js b/src-docs/src/views/flyout/flyout_example.js index 43cf6d7533d..7eb5566eed4 100644 --- a/src-docs/src/views/flyout/flyout_example.js +++ b/src-docs/src/views/flyout/flyout_example.js @@ -41,6 +41,7 @@ export const FlyoutExample = { from the right side of the screen. It should be used any time you need to perform quick, individual actions to a larger page or list.

+
  • size accepts s / m / l and @@ -52,6 +53,11 @@ export const FlyoutExample = { to within the flyout. It is off by default.
+ +

+ Notice how these examples use aria-labelledby and aria-describedby to + announce the flyout to screen readers when the user opens it. +

), props: { EuiFlyout }, diff --git a/src-docs/src/views/flyout/flyout_size.js b/src-docs/src/views/flyout/flyout_size.js index cd46b9f503e..98ec9cff728 100644 --- a/src-docs/src/views/flyout/flyout_size.js +++ b/src-docs/src/views/flyout/flyout_size.js @@ -45,10 +45,18 @@ export class FlyoutSize extends Component { ownFocus onClose={this.closeFlyout} size="s" + aria-labelledby="flyoutSizeTitle" + aria-describedby="flyoutSizeDescription" > -

You can use ESC to close this panel, but we could also pass in a close button like so.

+

+ A flyout +

+ +

+ You can use ESC to close this panel, but we could also pass in a close button like so. +

diff --git a/src/components/flyout/flyout.js b/src/components/flyout/flyout.js index fe799cbd33d..afbdf7d45ce 100644 --- a/src/components/flyout/flyout.js +++ b/src/components/flyout/flyout.js @@ -46,6 +46,7 @@ export class EuiFlyout extends Component { const flyoutContent = (
{ this.flyout = node; }} className={classes} tabIndex={0}