fix(ui): make modals safer on small screens

This commit is contained in:
Supra4E8C
2026-03-27 19:42:54 +08:00
parent 12103835ec
commit f9ef96a501
2 changed files with 45 additions and 1 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ export function Modal({
<div
ref={modalRef}
className={modalClass}
style={{ width }}
style={{ width, maxWidth: '100%' }}
role="dialog"
aria-modal="true"
aria-labelledby={title ? titleId : undefined}
+44
View File
@@ -411,6 +411,7 @@ textarea {
border-radius: $radius-lg;
border: 1px solid var(--border-color);
box-shadow: $shadow-lg;
max-width: 100%;
max-height: 90vh;
overflow: hidden;
display: flex;
@@ -523,6 +524,49 @@ textarea {
background: var(--bg-primary);
}
@media (max-width: $breakpoint-mobile) {
.modal-overlay {
padding: $spacing-md;
}
.modal {
max-height: calc(100vh - #{$spacing-md * 2});
border-radius: $radius-md;
}
@supports (height: 100dvh) {
.modal {
max-height: calc(100dvh - #{$spacing-md * 2});
}
}
.modal-header {
padding: $spacing-md;
padding-right: 52px;
}
.modal-body {
padding: $spacing-md;
max-height: min(60vh, calc(100vh - 180px));
}
@supports (height: 100dvh) {
.modal-body {
max-height: min(60dvh, calc(100dvh - 180px));
}
}
.modal-footer {
padding: $spacing-md;
flex-direction: column-reverse;
align-items: stretch;
}
.modal-footer .btn {
width: 100%;
}
}
.request-log-modal {
display: flex;
flex-direction: column;