From c9c4b6d259682fbaccfb74f98be91f5ea5899202 Mon Sep 17 00:00:00 2001 From: Sofiya Huts Date: Thu, 7 Feb 2019 15:24:02 +0100 Subject: [PATCH 1/3] fix(Popup): Focus the last focused element outside Popup on ESC --- packages/react/src/components/Popup/Popup.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/Popup/Popup.tsx b/packages/react/src/components/Popup/Popup.tsx index 3bc037579c..16969eacbf 100644 --- a/packages/react/src/components/Popup/Popup.tsx +++ b/packages/react/src/components/Popup/Popup.tsx @@ -166,13 +166,15 @@ export default class Popup extends AutoControlledComponent { - this.close(e, () => _.invoke(this.triggerDomElement, 'focus')) + this.close(e, () => _.invoke(this.triggerFocusableDomElement, 'focus')) e.stopPropagation() }, close: e => this.close(e), @@ -474,6 +476,8 @@ export default class Popup extends AutoControlledComponent Date: Thu, 7 Feb 2019 15:40:21 +0100 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e50426a0f..c395f612dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add single search flavor for `Dropdown` component @Bugaa92 ([#839](https://github.com/stardust-ui/react/pull/839)) - Add multiple selection flavor for `Dropdown` component @Bugaa92 ([#845](https://github.com/stardust-ui/react/pull/845)) +### Fixes +- Focus the last focused element which triggered `Popup` on ESC @sophieH29 ([#861](https://github.com/stardust-ui/react/pull/861)) + ## [v0.20.0](https://github.com/stardust-ui/react/tree/v0.20.0) (2019-02-06) [Compare changes](https://github.com/stardust-ui/react/compare/v0.19.2...v0.20.0) From f17ad95ec336635f58af597f9f06da168c77edc7 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Fri, 8 Feb 2019 10:46:35 +0100 Subject: [PATCH 3/3] Update packages/react/src/components/Popup/Popup.tsx Co-Authored-By: sophieH29 <8460706+sophieH29@users.noreply.github.com> --- packages/react/src/components/Popup/Popup.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/Popup/Popup.tsx b/packages/react/src/components/Popup/Popup.tsx index 16969eacbf..4855bfbba5 100644 --- a/packages/react/src/components/Popup/Popup.tsx +++ b/packages/react/src/components/Popup/Popup.tsx @@ -477,7 +477,9 @@ export default class Popup extends AutoControlledComponent