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

fix(Popup): Stop event propagation when press Escape on the popup #515

Merged
merged 3 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

},
}

private closeAndFocusTrigger = e => {
Expand Down