Fix drag UX: single-select on click and auto-unlock locked component on manual move
Some checks are pending
CI / test (push) Waiting to run
Some checks are pending
CI / test (push) Waiting to run
This commit is contained in:
parent
2131340c01
commit
9f5ff8eb42
@ -1761,9 +1761,7 @@ function bindSvgInteractions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!state.selectedRefs.includes(ref)) {
|
selectSingleRef(ref);
|
||||||
selectSingleRef(ref);
|
|
||||||
}
|
|
||||||
state.selectedNet = null;
|
state.selectedNet = null;
|
||||||
state.selectedPin = null;
|
state.selectedPin = null;
|
||||||
state.isolateNet = false;
|
state.isolateNet = false;
|
||||||
@ -1778,6 +1776,14 @@ function bindSvgInteractions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pt = canvasToSvgPoint(evt.clientX, evt.clientY);
|
const pt = canvasToSvgPoint(evt.clientX, evt.clientY);
|
||||||
|
const clickedInst = instanceByRef(ref);
|
||||||
|
if (clickedInst?.placement?.locked) {
|
||||||
|
pushHistory("auto-unlock-drag");
|
||||||
|
clickedInst.placement.locked = false;
|
||||||
|
el.jsonFeedback.textContent = `${ref} was locked and has been auto-unlocked for manual move.`;
|
||||||
|
renderSelected();
|
||||||
|
}
|
||||||
|
|
||||||
const dragRefsRaw = state.selectedRefs.length ? [...state.selectedRefs] : [ref];
|
const dragRefsRaw = state.selectedRefs.length ? [...state.selectedRefs] : [ref];
|
||||||
const dragRefs = dragRefsRaw.filter((r) => !instanceByRef(r)?.placement?.locked);
|
const dragRefs = dragRefsRaw.filter((r) => !instanceByRef(r)?.placement?.locked);
|
||||||
if (!dragRefs.length) {
|
if (!dragRefs.length) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user