mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 05:51:56 +08:00
Fix: replace onClick with onMouseDown for Modal (#57)
This commit is contained in:
parent
5026062347
commit
1384ec6908
@ -60,7 +60,7 @@ export function Modal (props: ModalProps) {
|
||||
return () => { document.body.removeChild(current) }
|
||||
}, [])
|
||||
|
||||
function handleMaskClick (e: MouseEvent) {
|
||||
function handleMaskMouseDown (e: MouseEvent) {
|
||||
if (e.target === maskRef.current) {
|
||||
onClose()
|
||||
}
|
||||
@ -70,7 +70,7 @@ export function Modal (props: ModalProps) {
|
||||
<div
|
||||
className={classnames('modal-mask', { 'modal-show': show })}
|
||||
ref={maskRef}
|
||||
onClick={handleMaskClick}
|
||||
onMouseDown={handleMaskMouseDown}
|
||||
>
|
||||
<div
|
||||
className={classnames('modal', `modal-${size}`, className)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user