禁止双击放大

This commit is contained in:
YI FANG
2025-12-01 10:32:18 +08:00
parent 63a935fc25
commit 92470013de
2 changed files with 24 additions and 3 deletions

View File

@@ -29,9 +29,30 @@ export const ExamModal = ({ client, tab, onTabChange, onClose }: ExamModalProps)
print: printDone,
};
const handleDoubleClick = (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
};
const handleTouchStart = (e: React.TouchEvent) => {
if (e.touches.length > 1) {
e.preventDefault();
}
};
return (
<div className='fixed inset-0 z-40 flex items-center justify-center bg-black/50'>
<div className='w-[960px] max-w-[95vw] bg-white rounded-2xl shadow-xl overflow-hidden text-sm'>
<div
className='fixed inset-0 z-40 flex items-center justify-center bg-black/50'
style={{ touchAction: 'none' }}
onDoubleClick={handleDoubleClick}
onTouchStart={handleTouchStart}
>
<div
className='w-[960px] max-w-[95vw] bg-white rounded-2xl shadow-xl overflow-hidden text-sm'
style={{ touchAction: 'none' }}
onDoubleClick={handleDoubleClick}
onTouchStart={handleTouchStart}
>
{/* Header 区域:增加了内边距 padding */}
<div className='px-8 pt-6 pb-2'>