mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Fixed modal scroll bug in AdminX Design System
refs. https://github.com/TryGhost/Team/issues/3318
This commit is contained in:
parent
9657556265
commit
2387718266
1 changed files with 6 additions and 4 deletions
|
@ -76,13 +76,15 @@ const Modal: React.FC<ModalProps> = ({size = 'md', title, okLabel, cancelLabel,
|
|||
break;
|
||||
}
|
||||
|
||||
const handleBackdropClick = () => {
|
||||
modal.remove();
|
||||
const handleBackdropClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
modal.remove();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={backdropStyles} id='modal-backdrop'>
|
||||
<div className='fixed inset-0 z-0 bg-[rgba(0,0,0,0.1)]' onClick={handleBackdropClick}></div>
|
||||
<div className={backdropStyles} id='modal-backdrop' onClick={handleBackdropClick}>
|
||||
<div className='pointer-events-none fixed inset-0 z-0 bg-[rgba(0,0,0,0.1)]'></div>
|
||||
<section className={modalStyles}>
|
||||
<div>
|
||||
{title && <Heading level={4}>{title}</Heading>}
|
||||
|
|
Loading…
Add table
Reference in a new issue