diff --git a/projects/core/directives/dropdown/dropdown.style.less b/projects/core/directives/dropdown/dropdown.style.less index ad66c375b005..b736edc05e80 100644 --- a/projects/core/directives/dropdown/dropdown.style.less +++ b/projects/core/directives/dropdown/dropdown.style.less @@ -27,6 +27,7 @@ .t-scroll { flex-grow: 1; max-inline-size: 100%; + inline-size: max-content; overscroll-behavior: none; } diff --git a/projects/demo-playwright/tests/core/dropdown/dropdown.pw.spec.ts b/projects/demo-playwright/tests/core/dropdown/dropdown.pw.spec.ts index b5efaa0871ad..30efc670b097 100644 --- a/projects/demo-playwright/tests/core/dropdown/dropdown.pw.spec.ts +++ b/projects/demo-playwright/tests/core/dropdown/dropdown.pw.spec.ts @@ -55,6 +55,16 @@ test.describe('Dropdown', () => { await expect(page).toHaveScreenshot('05-dropdown.png'); }); + test('Hosted dropdown initial width', async ({page}) => { + await tuiGoto(page, DemoRoute.Viewport); + const example = new TuiDocumentationPagePO(page).getExample('#portal'); + + await example.scrollIntoViewIfNeeded(); + await example.locator('.t2').click({force: true}); + + await expect(page).toHaveScreenshot('13-dropdown.png'); + }); + test('Esc -> Hosted Dropdown', async ({page}) => { await tuiGoto(page, DemoRoute.DropdownOpen); const example = new TuiDocumentationPagePO(page).getExample('#tui-dropdown-host');