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

Commit c7bef52

Browse files
authored
fix(Popup): Stop event propagation when press Escape on the popup (#515)
* Stop event propagation when press Escape on the popup * Improvements after CR comments * Update changelog
1 parent ef38731 commit c7bef52

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2222

2323
### Fixes
2424
- Fix the behaviour of `AutoControlledComponent` when `undefined` is passed as a prop value @layershifter ([#499](https://github.com/stardust-ui/react/pull/499))
25+
- Stop event propagation when press Escape on the popup @sophieH29 ([#515](https://github.com/stardust-ui/react/pull/515))
2526

2627
<!--------------------------------[ v0.12.0 ]------------------------------- -->
2728
## [v0.12.0](https://github.com/stardust-ui/react/tree/v0.12.0) (2018-11-19)

src/components/Popup/Popup.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ export default class Popup extends AutoControlledComponent<Extendable<PopupProps
128128
toggle: e => {
129129
this.trySetOpen(!this.state.open, e, true)
130130
},
131-
closeAndFocusTrigger: e => this.closeAndFocusTrigger(e),
131+
closeAndFocusTrigger: e => {
132+
this.closeAndFocusTrigger(e)
133+
e.stopPropagation()
134+
},
132135
}
133136

134137
private closeAndFocusTrigger = e => {

0 commit comments

Comments
 (0)