Skip to content

Commit 970bcad

Browse files
author
Jackson Kearl
committed
Fix bug where expanded tasks did not adjust height on layout
1 parent 1bcf2a3 commit 970bcad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export class GettingStartedPage extends EditorPane {
114114
private tasExperimentService?: ITASExperimentService;
115115
private previousSelection?: string;
116116
private recentlyOpened: Promise<IRecentlyOpened>;
117+
private selectedTaskElement?: HTMLDivElement;
117118

118119
constructor(
119120
@ICommandService private readonly commandService: ICommandService,
@@ -287,13 +288,15 @@ export class GettingStartedPage extends EditorPane {
287288
if (this.editorInput.selectedTask === id && contractIfAlreadySelected) {
288289
this.previousSelection = this.editorInput.selectedTask;
289290
this.editorInput.selectedTask = undefined;
291+
this.selectedTaskElement = undefined;
290292
return;
291293
}
292294
taskElement.style.height = `${taskElement.scrollHeight}px`;
293295
if (!this.currentCategory || this.currentCategory.content.type !== 'items') {
294296
throw Error('cannot expand task for category of non items type' + this.currentCategory?.id);
295297
}
296298
this.editorInput.selectedTask = id;
299+
this.selectedTaskElement = taskElement;
297300
const taskToExpand = assertIsDefined(this.currentCategory.content.items.find(task => task.id === id));
298301

299302
mediaElement.setAttribute('alt', taskToExpand.media.altText);
@@ -594,6 +597,12 @@ export class GettingStartedPage extends EditorPane {
594597
this.detailsScrollbar?.scanDomNode();
595598
this.detailImageScrollbar?.scanDomNode();
596599
this.container.classList[size.height <= 685 ? 'add' : 'remove']('height-constrained');
600+
601+
602+
if (this.selectedTaskElement) {
603+
this.selectedTaskElement.style.height = ``; // unset or the scrollHeight will just be the old height
604+
this.selectedTaskElement.style.height = `${this.selectedTaskElement.scrollHeight}px`;
605+
}
597606
}
598607

599608
private updateCategoryProgress() {

0 commit comments

Comments
 (0)