mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-24 06:21:26 -03:00
fix(ui): preserve group editor scroll position when toggling tags
This commit is contained in:
@@ -439,6 +439,12 @@ function renderGroupEditor(widget, tagData, index) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Preserve the scroll position across re-renders: toggling a child tag
|
||||
// rebuilds the whole panel, and a fresh panel would otherwise jump back
|
||||
// to the top.
|
||||
const previousScrollTop = state.panelEl ? state.panelEl.scrollTop : 0;
|
||||
const previousScrollLeft = state.panelEl ? state.panelEl.scrollLeft : 0;
|
||||
|
||||
if (state.panelEl) {
|
||||
state.panelEl.remove();
|
||||
}
|
||||
@@ -551,6 +557,8 @@ function renderGroupEditor(widget, tagData, index) {
|
||||
state.lastAnchorRect = getRectSnapshot(state.anchorEl);
|
||||
attachGroupEditorCloseHandlers(widget);
|
||||
positionGroupEditor(widget);
|
||||
panel.scrollTop = previousScrollTop;
|
||||
panel.scrollLeft = previousScrollLeft;
|
||||
startGroupEditorTracking(widget);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user