Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
fix(Popup): Stop event propagation when press Escape on the popup (#515)
Browse files Browse the repository at this point in the history
* Stop event propagation when press Escape on the popup

* Improvements after CR comments

* Update changelog
  • Loading branch information
sophieH29 authored Nov 22, 2018
1 parent ef38731 commit c7bef52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]------------------------------- -->
## [v0.12.0](https://github.com/stardust-ui/react/tree/v0.12.0) (2018-11-19)
Expand Down
5 changes: 4 additions & 1 deletion src/components/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export default class Popup extends AutoControlledComponent<Extendable<PopupProps
toggle: e => {
this.trySetOpen(!this.state.open, e, true)
},
closeAndFocusTrigger: e => this.closeAndFocusTrigger(e),
closeAndFocusTrigger: e => {
this.closeAndFocusTrigger(e)
e.stopPropagation()
},
}

private closeAndFocusTrigger = e => {
Expand Down

0 comments on commit c7bef52

Please sign in to comment.