Browse Source

Fix popup closing by click

master
Eduard Kuzmenko 4 years ago
parent
commit
190f3cf1aa
  1. 3
      src/components/popups/index.ts

3
src/components/popups/index.ts

@ -55,10 +55,11 @@ export default class PopupElement { @@ -55,10 +55,11 @@ export default class PopupElement {
const onOverlayClick = (e: MouseEvent) => {
if(!findUpClassName(e.target, 'popup-container')) {
this.btnClose.click();
this.element.removeEventListener('click', onOverlayClick);
}
};
this.element.addEventListener('click', onOverlayClick, {once: true});
this.element.addEventListener('click', onOverlayClick);
}
}

Loading…
Cancel
Save