Skip to content

Commit b7ba2c7

Browse files
committedDec 6, 2024
fix(Modal): prevent from going out of screen
Resolves #2711
1 parent 198d04d commit b7ba2c7

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed
 

‎src/theme/modal.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
overlay: 'fixed inset-0 bg-[var(--ui-bg-elevated)]/75',
44
content: 'fixed w-full h-dvh bg-[var(--ui-bg)] divide-y divide-[var(--ui-border)] flex flex-col focus:outline-none',
55
header: 'px-4 py-5 sm:px-6',
6-
body: 'flex-1 p-4 sm:p-6',
6+
body: 'flex-1 overflow-y-auto p-4 sm:p-6',
77
footer: 'flex items-center gap-1.5 p-4 sm:px-6',
88
title: 'text-[var(--ui-text-highlighted)] font-semibold',
99
description: 'mt-1 text-[var(--ui-text-muted)] text-sm',
@@ -21,7 +21,7 @@ export default {
2121
content: 'inset-0'
2222
},
2323
false: {
24-
content: 'top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-[calc(var(--ui-radius)*2)] sm:shadow-lg sm:ring ring-[var(--ui-border)]'
24+
content: 'top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:max-h-[calc(100vh-4rem)] sm:rounded-[calc(var(--ui-radius)*2)] sm:shadow-lg sm:ring ring-[var(--ui-border)]'
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)
Please sign in to comment.