mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01: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) }
|
return () => { document.body.removeChild(current) }
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
function handleMaskClick (e: MouseEvent) {
|
function handleMaskMouseDown (e: MouseEvent) {
|
||||||
if (e.target === maskRef.current) {
|
if (e.target === maskRef.current) {
|
||||||
onClose()
|
onClose()
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ export function Modal (props: ModalProps) {
|
|||||||
<div
|
<div
|
||||||
className={classnames('modal-mask', { 'modal-show': show })}
|
className={classnames('modal-mask', { 'modal-show': show })}
|
||||||
ref={maskRef}
|
ref={maskRef}
|
||||||
onClick={handleMaskClick}
|
onMouseDown={handleMaskMouseDown}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classnames('modal', `modal-${size}`, className)}
|
className={classnames('modal', `modal-${size}`, className)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user