fix: 弹窗宽度边距增至2rem防切边,弹窗整体隐藏滚动条
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/** shadcn/ui 风格 Dialog(基于 @radix-ui/react-dialog)
|
||||
* DialogContent 用 flex flex-col + overflow-x-hidden,适配移动端 w-[calc(100vw-1.5rem)] max-w-lg
|
||||
* DialogContent 用 flex flex-col + overflow-x-hidden,适配移动端 w-[calc(100vw-2rem)] max-w-lg
|
||||
*/
|
||||
import { forwardRef } from 'react'
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog'
|
||||
@@ -35,7 +35,7 @@ const DialogContent = forwardRef<
|
||||
<DialogPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'fixed left-[50%] top-[50%] z-50 flex w-[calc(100vw-1.5rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] flex-col gap-4 overflow-x-hidden overflow-y-auto border border-border bg-background p-4 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg sm:p-6',
|
||||
'fixed left-[50%] top-[50%] z-50 flex w-[calc(100vw-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] flex-col gap-4 overflow-x-hidden overflow-y-auto border border-border bg-background p-4 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg sm:p-6 scrollbar-none',
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
|
||||
Reference in New Issue
Block a user