fix(dropzone): Prevent dropzone from overflowing content

This commit is contained in:
Maksim Eltyshev
2026-02-19 17:09:21 +01:00
parent 7758312e05
commit 2a1760393f
4 changed files with 26 additions and 8 deletions
@@ -132,7 +132,11 @@ const AddAttachmentZone = React.memo(({ children }) => {
<> <>
{/* eslint-disable-next-line react/jsx-props-no-spreading */} {/* eslint-disable-next-line react/jsx-props-no-spreading */}
<div {...getRootProps()}> <div {...getRootProps()}>
{isDragActive && <div className={styles.dropzone}>{t('common.dropFileToUpload')}</div>} {isDragActive && (
<div className={styles.dropzone}>
<div className={styles.dropzoneText}>{t('common.dropFileToUpload')}</div>
</div>
)}
{children} {children}
{/* eslint-disable-next-line react/jsx-props-no-spreading */} {/* eslint-disable-next-line react/jsx-props-no-spreading */}
<input {...getInputProps()} /> <input {...getInputProps()} />
@@ -8,13 +8,18 @@
background: white; background: white;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
height: 100%; inset: 0;
line-height: 30px; line-height: 30px;
opacity: 0.7; opacity: 0.7;
padding: 200px 50px;
position: absolute; position: absolute;
text-align: center; text-align: center;
width: 100%;
z-index: 2001; z-index: 2001;
} }
.dropzoneText {
left: 50%;
position: absolute;
top: min(200px, 50%);
transform: translateX(-50%) translateY(-50%);
}
} }
@@ -68,7 +68,11 @@ const AddImageZone = React.memo(({ children, onCreate }) => {
return ( return (
/* eslint-disable-next-line react/jsx-props-no-spreading */ /* eslint-disable-next-line react/jsx-props-no-spreading */
<div {...getRootProps()}> <div {...getRootProps()}>
{isDragActive && <div className={styles.dropzone}>{t('common.dropFileToUpload')}</div>} {isDragActive && (
<div className={styles.dropzone}>
<div className={styles.dropzoneText}>{t('common.dropFileToUpload')}</div>
</div>
)}
{children} {children}
{/* eslint-disable-next-line react/jsx-props-no-spreading */} {/* eslint-disable-next-line react/jsx-props-no-spreading */}
<input {...getInputProps()} /> <input {...getInputProps()} />
@@ -8,13 +8,18 @@
background: white; background: white;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
height: 100%; inset: 0;
line-height: 30px; line-height: 30px;
opacity: 0.7; opacity: 0.7;
padding-top: 200px;
position: absolute; position: absolute;
text-align: center; text-align: center;
width: 100%;
z-index: 2001; z-index: 2001;
} }
.dropzoneText {
left: 50%;
position: absolute;
top: min(200px, 50%);
transform: translateX(-50%) translateY(-50%);
}
} }