mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
fix(mobile): close the details card when a touch lands outside it
Co-authored-by: zhangxaochen <3416677+zhangxaochen@users.noreply.github.com>
This commit is contained in:
co-authored by
zhangxaochen
parent
bfa941aa06
commit
d7870409c4
@@ -47,7 +47,7 @@ export function useDetailCardScope({
|
||||
record.restore = false
|
||||
dismiss()
|
||||
}
|
||||
const click = (event: MouseEvent) => {
|
||||
const press = (event: MouseEvent) => {
|
||||
if (!inside(event.target) && !headerBack(event.target)) {
|
||||
outside()
|
||||
}
|
||||
@@ -120,7 +120,9 @@ export function useDetailCardScope({
|
||||
}
|
||||
}
|
||||
const capture = { capture: true, signal: listeners.signal }
|
||||
document.addEventListener('click', click, capture)
|
||||
// Why: iOS sends no click for a touch whose touchmove was prevented, as the terminal does for any finger movement.
|
||||
document.addEventListener('pointerdown', press, capture)
|
||||
document.addEventListener('click', press, capture)
|
||||
document.addEventListener('keydown', key, capture)
|
||||
document.addEventListener('keyup', key, capture)
|
||||
document.addEventListener('keydown', isolate, { signal: listeners.signal })
|
||||
|
||||
Reference in New Issue
Block a user