diff --git a/demo/index.html b/demo/index.html index ac7abb8b..14da7cb2 100644 --- a/demo/index.html +++ b/demo/index.html @@ -15,7 +15,7 @@

focus-trap-react demo

- Return to the repository + Return to the repository

defaults

@@ -45,6 +45,10 @@

special element

ALSO, when you click outside this FocusTrap, the trap deactivates and your click carries through.

+

+ Finally, focus should return to the "activate trap" button, whether you click the "deactivate trap" + button, or press the ESC key. +

demo autofocus

@@ -55,7 +59,7 @@

demo autofocus

- Return to the repository + Return to the repository

diff --git a/demo/js/demo-autofocus.js b/demo/js/demo-autofocus.js index c4aa20ed..4f8f41a7 100644 --- a/demo/js/demo-autofocus.js +++ b/demo/js/demo-autofocus.js @@ -31,7 +31,7 @@ class DemoAutofocus extends React.Component { onDeactivate: this.unmountTrap, }} > -
+
Another focusable thing diff --git a/demo/js/demo-defaults.js b/demo/js/demo-defaults.js index 9c9c339e..e2b9551b 100644 --- a/demo/js/demo-defaults.js +++ b/demo/js/demo-defaults.js @@ -31,7 +31,7 @@ class DemoDefaults extends React.Component { onDeactivate: this.unmountTrap, }} > -
+

Here is a focus trap with some{' '} focusable parts. diff --git a/demo/js/demo-ffne.js b/demo/js/demo-ffne.js index eaca44b5..a78c749a 100644 --- a/demo/js/demo-ffne.js +++ b/demo/js/demo-ffne.js @@ -33,7 +33,7 @@ class DemoFfne extends React.Component { escapeDeactivates: false, }} > -

+

Here is a focus trap with some{' '} focusable parts. diff --git a/demo/js/demo-special-element.js b/demo/js/demo-special-element.js index 4b597383..13f1458e 100644 --- a/demo/js/demo-special-element.js +++ b/demo/js/demo-special-element.js @@ -26,7 +26,9 @@ class DemoSpecialElement extends React.Component { render() { let trapClass = 'trap'; - if (this.state.activeTrap) trapClass += ' is-active'; + if (this.state.activeTrap) { + trapClass += ' is-active'; + } return (

@@ -38,11 +40,12 @@ class DemoSpecialElement extends React.Component { focusTrapOptions={{ onDeactivate: this.unmountTrap, clickOutsideDeactivates: true, + returnFocusOnDeactivate: true, }} >