Skip to content

Commit bf49b09

Browse files
authored
Ensure element is not rendered to 0px when updating height async (microsoft#232281)
This can happen because templateParts are now not disposed when an element is unregistered, but we have to keep their listeners around because they are reused on the next render. A more complete non-candidate fix might be to check whether the element is in the DOM before rendering it at all. But the safe fix here is to just make sure it doesn't go to 0, so that the list doesn't skip rendering it entirely. Fix microsoft/vscode-copilot#9260
1 parent ac6f204 commit bf49b09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
584584
return;
585585
}
586586

587-
const newHeight = templateData.rowContainer.offsetHeight;
587+
const newHeight = Math.max(templateData.rowContainer.offsetHeight, 1);
588588
templateData.currentElement.currentRenderedHeight = newHeight;
589589
this._onDidChangeItemHeight.fire({ element: templateData.currentElement, height: newHeight });
590590
}

0 commit comments

Comments
 (0)