Skip to content

Commit 78a71e8

Browse files
Skip the recompose-and-set side effect when the scrub-end text write fires the binding
Guard binding(for:layout:)'s set closure with !isScrubbing: onDragEnd/ handleScrollEnded write text once at scrub end purely to unfreeze the field's display, but that write re-triggers previewIfValid, which recomposes eyedropper.color from the still-stale, non-dragged component values and overwrites the correct live colour right before finishEditing(commitLiveScrubColor: true) commits it - reopening the bug 0a768f3 just fixed via a different path.
1 parent 0a768f3 commit 78a71e8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Pika/Views/EditableColorValue.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ struct EditableColorValue: View {
268268
}
269269
guard index < values.count else { return }
270270
values[index] = newValue
271+
// A scrub's own end (`ScrubTextField.onDragEnd`/`handleScrollEnded`) writes here
272+
// once, only to unfreeze the field's displayed text — not to request a new
273+
// colour. `values` at that point still holds the *other* components' stale
274+
// session-start numbers (only `index` was just updated), so recomposing here
275+
// would clobber `eyedropper.color`, which `previewLiveScrub` already kept correct
276+
// every frame, with a wrong colour right before `finishEditing`'s
277+
// `commitLiveScrubColor` commits it.
278+
guard !isScrubbing else { return }
271279
previewIfValid(layout: layout)
272280
}
273281
)

0 commit comments

Comments
 (0)