fix: signal-backed marker reactivity and stale signal re-push
Two issues discovered during testing: 1. data-effect expressions for signal-backed markers short-circuited before reading $signalID when the map hadn't loaded yet. Datastar never tracked those signals as dependencies, so the effect never re-ran. Fix: read signal values unconditionally before the guard. 2. prepareSignalsForPatch never reset changed=false on regular signals (only computed ones), causing every SyncSignals() call to re-push all signals — including stale server-side values for the draggable pin, overwriting the client-side drag position.
This commit is contained in:
@@ -291,6 +291,7 @@ func (c *Context) prepareSignalsForPatch() map[string]any {
|
||||
}
|
||||
if sig.changed {
|
||||
updatedSigs[sigID.(string)] = fmt.Sprintf("%v", sig.val)
|
||||
sig.changed = false
|
||||
}
|
||||
case *computedSignal:
|
||||
sig.recompute()
|
||||
|
||||
Reference in New Issue
Block a user