diff --git a/CHANGELOG.md b/CHANGELOG.md index ea37e39175..d52067418e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add `black` and `white` options for the `color` prop of the `Label` component @mnajdova ([#855](https://github.com/stardust-ui/react/pull/855)) - Add `Flex` component @kuzhelov ([#802](https://github.com/stardust-ui/react/pull/802)) +### 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) diff --git a/packages/react/src/components/Popup/Popup.tsx b/packages/react/src/components/Popup/Popup.tsx index 3bc037579c..4855bfbba5 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,10 @@ export default class Popup extends AutoControlledComponent