test(editor): V1-2.6 browser journeys on the sandbox, touch drag and findings fixes
This commit is contained in:
1 parent
7bbd096a16
commit
5097fd7484
18 files changed
+3010
-8
No files matched your search
@@ -68,13 +68,18 @@ function clickHandler(input: GestureInput, framing: Framing) {
|
||||
}
|
||||
}
|
||||
|
||||
/** `touch-action: none` only while a drawing tool, a drag or a zoom is active. */
|
||||
/**
|
||||
* `touch-action: none` while a drawing tool, a drag, a zoom or a movable selection is
|
||||
* active: the browser reads it at touchstart, so a touch drag of the selected marker
|
||||
* would otherwise be taken as a pan and cancelled before the drag is armed.
|
||||
*/
|
||||
function touchStyle(
|
||||
tool: ToolId,
|
||||
armed: boolean,
|
||||
scale: number,
|
||||
movable: boolean,
|
||||
): CSSProperties {
|
||||
const none = tool !== 'select' || armed || scale !== 1
|
||||
const none = tool !== 'select' || armed || scale !== 1 || movable
|
||||
return { touchAction: none ? 'none' : 'pan-x pan-y' }
|
||||
}
|
||||
|
||||
@@ -103,7 +108,12 @@ export function useCanvasGestures(input: GestureInput) {
|
||||
...composedPointer(framing, move),
|
||||
onKeyDown,
|
||||
onClick: clickHandler(input, framing),
|
||||
style: touchStyle(input.tool, move.armed, framing.framing.scale),
|
||||
style: touchStyle(
|
||||
input.tool,
|
||||
move.armed,
|
||||
framing.framing.scale,
|
||||
input.moveTarget !== null,
|
||||
),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user