Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Sep 25, 2024
1 parent 643a763 commit d8fec5b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/core/directives/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class TuiDropdownComponent {
)
.subscribe({
next: (styles) => Object.assign(this.el.style, styles),
complete: () => this.close(),
complete: () => this.close?.(),
});

protected readonly close = (): void => this.directive.toggle(false);
Expand Down
2 changes: 1 addition & 1 deletion projects/core/directives/hint/hint.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class TuiHintComponent<C = any> {
constructor() {
inject(TuiPositionService)
.pipe(
takeWhile(() => this.hint.el.isConnected && !!this.hint.el.offsetParent),
takeWhile(() => this.hint.el.isConnected),
map((point) => this.vvs.correct(point)),
takeUntilDestroyed(),
)
Expand Down
16 changes: 16 additions & 0 deletions projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,20 @@ test.describe('Dropdown', () => {

await expect(page.locator('tui-dropdown')).not.toBeVisible();
});

test('hidden-host', async ({page}) => {
await tuiGoto(page, DemoRoute.Dropdown);
const example = new TuiDocumentationPagePO(page).getExample('#basic');

await example.scrollIntoViewIfNeeded();
await example.locator('button').click();

expect(page.locator('tui-dropdown')).toBeDefined();

await example.locator('button').evaluate((el) => {
el.style.display = 'none';
});

await expect(page).toHaveScreenshot('12-dropdown-hidden-host.png');
});
});

0 comments on commit d8fec5b

Please sign in to comment.