diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.html index e3bc5e733c48..f349c6e78987 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.html @@ -7,11 +7,12 @@ [attr.aria-labelledby]="'field-' + field.variable" [virtualScroll]="true" [virtualScrollItemSize]="50" + [scrollHeight]="'450px'" [virtualScrollOptions]="{ autoSize: true, style: { width: '100%', - height: '500px' + height: '450px' } }" filterBy="label" diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.spec.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.spec.ts index e88f4b52a428..c0d29272f5da 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.spec.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-host-folder-field/dot-edit-content-host-folder-field.component.spec.ts @@ -87,6 +87,21 @@ describe('DotEditContentHostFolderFieldComponent', () => { expect(spyloadSites).toHaveBeenCalled(); }); + it('should tree selection height and virtual scroll height be the same', async () => { + spectator.detectChanges(); + + const triggerElement = spectator.query('.p-treeselect-trigger'); + spectator.click(triggerElement); + + await spectator.fixture.whenStable(); + + const treeSelectHeight = spectator.component.treeSelect.scrollHeight; + const treeVirtualScrollHeight = + spectator.component.treeSelect.virtualScrollOptions.style['height']; + + expect(treeSelectHeight).toBe(treeVirtualScrollHeight); + }); + describe('The init value with the root path', () => { it('should show a root path', () => { store.tree.set(TREE_SELECT_SITES_MOCK);