Merge branch 'dev'
This commit is contained in:
commit
1cd8e9a6be
|
|
@ -576,10 +576,14 @@ export class FolkShape extends FolkElement {
|
||||||
const isDragHandle = target?.closest?.(".header, [data-drag]") !== null;
|
const isDragHandle = target?.closest?.(".header, [data-drag]") !== null;
|
||||||
|
|
||||||
if (event instanceof PointerEvent) {
|
if (event instanceof PointerEvent) {
|
||||||
|
// For pointerdown on non-drag targets (content areas, inputs, etc.),
|
||||||
|
// stop immediate propagation so canvas selection/snap listeners don't fire.
|
||||||
|
if (event.type === "pointerdown" && target !== this && !handle && !isDragHandle) {
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (event.type === "pointerdown") {
|
if (event.type === "pointerdown") {
|
||||||
// Allow drag from: the host itself, a handle, or a drag handle element
|
|
||||||
if (target !== this && !handle && !isDragHandle) return;
|
|
||||||
|
|
||||||
// If clicking on the shape body (not a handle), check if a text input
|
// If clicking on the shape body (not a handle), check if a text input
|
||||||
// is under the pointer — if so, enter edit mode immediately instead of dragging.
|
// is under the pointer — if so, enter edit mode immediately instead of dragging.
|
||||||
|
|
|
||||||
|
|
@ -3777,8 +3777,15 @@ Use real coordinates, YYYY-MM-DD dates, ISO currency codes. Ask clarifying quest
|
||||||
const shapeLastPos = new Map();
|
const shapeLastPos = new Map();
|
||||||
|
|
||||||
function setupShapeEventListeners(shape) {
|
function setupShapeEventListeners(shape) {
|
||||||
// Track position for group dragging
|
// Track position for group dragging — only for actual drag targets
|
||||||
shape.addEventListener("pointerdown", () => {
|
// (host element, resize/rotation handles, or drag handles like .header)
|
||||||
|
shape.addEventListener("pointerdown", (e) => {
|
||||||
|
const target = e.composedPath()[0];
|
||||||
|
const isHost = target === shape;
|
||||||
|
const isHandle = target?.getAttribute?.("part")?.startsWith?.("resize") ||
|
||||||
|
target?.getAttribute?.("part")?.startsWith?.("rotation");
|
||||||
|
const isDragHandle = target?.closest?.(".header, [data-drag]") !== null;
|
||||||
|
if (!isHost && !isHandle && !isDragHandle) return;
|
||||||
shapeLastPos.set(shape.id, { x: shape.x, y: shape.y });
|
shapeLastPos.set(shape.id, { x: shape.x, y: shape.y });
|
||||||
onShapeMoveStart(shape);
|
onShapeMoveStart(shape);
|
||||||
}, { capture: true });
|
}, { capture: true });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue