mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-15 04:35:57 +05:30
#140: do not close popup on overlay click, if a dropdown menu is active
This commit is contained in:
parent
d5ca191ace
commit
2ee5105752
@ -38,7 +38,9 @@ export default class Dropdown extends FormInputComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
document.addEventListener('click', this.onBodyClick);
|
// listen to capturing phase to ensure, that our event handler will be
|
||||||
|
// called before all other
|
||||||
|
document.addEventListener('click', this.onBodyClick, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@ -129,6 +131,7 @@ export default class Dropdown extends FormInputComponent {
|
|||||||
|
|
||||||
if (!el.contains(event.target) && el !== event.taget) {
|
if (!el.contains(event.target) && el !== event.taget) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
this.toggle();
|
this.toggle();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user