mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 13:12:10 +00:00
fix: avoid per-frame reactive mutations in DomWidgets positioning
Amp-Thread-ID: https://ampcode.com/threads/T-019cbb69-3404-726a-8888-182193115b88
This commit is contained in:
@@ -118,16 +118,27 @@ function composeStyle() {
|
||||
}
|
||||
}
|
||||
|
||||
watch([() => widgetState.pos, () => widgetState.size, left, top], () => {
|
||||
updatePosition(widgetState)
|
||||
if (enableDomClipping.value) {
|
||||
updateDomClipping()
|
||||
}
|
||||
composeStyle()
|
||||
})
|
||||
|
||||
watch(
|
||||
[() => widgetState, left, top, enableDomClipping],
|
||||
([widgetState]) => {
|
||||
updatePosition(widgetState)
|
||||
[
|
||||
() => widgetState.zIndex,
|
||||
() => widgetState.readonly,
|
||||
() => widgetState.positionOverride,
|
||||
enableDomClipping
|
||||
],
|
||||
() => {
|
||||
if (enableDomClipping.value) {
|
||||
updateDomClipping()
|
||||
}
|
||||
composeStyle()
|
||||
},
|
||||
{ deep: true }
|
||||
}
|
||||
)
|
||||
|
||||
// Recompose style when clippingStyle updates asynchronously via RAF.
|
||||
|
||||
Reference in New Issue
Block a user