diff --git a/CHANGELOG.md b/CHANGELOG.md index 012f4638a5..c9a63633da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixes - Fix the behaviour of `AutoControlledComponent` when `undefined` is passed as a prop value @layershifter ([#499](https://github.com/stardust-ui/react/pull/499)) +- Stop event propagation when press Escape on the popup @sophieH29 ([#515](https://github.com/stardust-ui/react/pull/515)) ## [v0.12.0](https://github.com/stardust-ui/react/tree/v0.12.0) (2018-11-19) diff --git a/src/components/Popup/Popup.tsx b/src/components/Popup/Popup.tsx index e8b3b27e23..b1001185e6 100644 --- a/src/components/Popup/Popup.tsx +++ b/src/components/Popup/Popup.tsx @@ -128,7 +128,10 @@ export default class Popup extends AutoControlledComponent { this.trySetOpen(!this.state.open, e, true) }, - closeAndFocusTrigger: e => this.closeAndFocusTrigger(e), + closeAndFocusTrigger: e => { + this.closeAndFocusTrigger(e) + e.stopPropagation() + }, } private closeAndFocusTrigger = e => {