island: fix pill jumping sideways when the compact face switches

fixes #3668
This commit is contained in:
bbedward committed 2026-10-06 11:02:32 -04:00
1 parent 766708c551
commit 069fa318d6
1 file changed
+9 -4
@@ -237,10 +237,15 @@ Item {
function syncAnchor() {
if (!root.freeMode && !root.embedded)
return;
const target = root.resolveTarget(controller.targetDescriptor);
const sameSize = target.width === motion.targetWidth && target.height === motion.targetHeight;
if (root.anchorSnaps || (root.embedded && !motion.running && !controller.expanded && sameSize)) {
motion.snapTo(target);
if (root.anchorSnaps) {
motion.snapTo(root.resolveTarget(controller.targetDescriptor));
return;
}
// targetDescriptor may not have updated yet when the slot resizes, compactTarget has.
const compact = root.resolveTarget(controller.compactTarget);
const settledCompact = root.embedded && !motion.running && !controller.expanded && compact.width === motion.targetWidth && compact.height === motion.targetHeight;
if (settledCompact) {
motion.snapTo(compact);
return;
}
root.applyTarget();