mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Fixed popup close on clicking outside content
no refs - Popup was not closing when clicked outside in the empty area as listener was firing on wrong element
This commit is contained in:
parent
2ed016f7d8
commit
f4f037452d
@ -74,6 +74,13 @@ class PopupContent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handlePopupClose(e) {
|
||||
e.preventDefault();
|
||||
if (e.target === e.currentTarget) {
|
||||
this.context.onAction('closePopup');
|
||||
}
|
||||
}
|
||||
|
||||
renderActivePage() {
|
||||
const {page} = this.context;
|
||||
getActivePage({page});
|
||||
@ -139,7 +146,7 @@ class PopupContent extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'gh-portal-popup-wrapper ' + pageClass}>
|
||||
<div className={'gh-portal-popup-wrapper ' + pageClass} onClick={e => this.handlePopupClose(e)}>
|
||||
<div className={(hasMode(['preview', 'dev']) ? 'gh-portal-popup-container preview' : 'gh-portal-popup-container') + ' ' + popupWidthStyle + ' ' + pageClass} style={pageStyle} ref={node => (this.node = node)} tabIndex="-1">
|
||||
<CookieDisabledBanner message={cookieBannerText} />
|
||||
{this.renderPopupNotification()}
|
||||
|
Loading…
Reference in New Issue
Block a user