Skip to content

Commit

Permalink
Merge branch 'v3.x' into input-date-time
Browse files Browse the repository at this point in the history
  • Loading branch information
alyonagerasimova authored Jun 7, 2024
2 parents 7cc43da + 22ee141 commit 30c3506
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export class TuiDropdownSelectionDirective
this.selection$.pipe(
map(() => this.getRange()),
distinctUntilChanged(
(x, y) => x.startOffset === y.startOffset && x.endOffset === y.endOffset,
(x, y) =>
x.startOffset === y.startOffset &&
x.endOffset === y.endOffset &&
x.commonAncestorContainer === y.commonAncestorContainer,
),
),
]).pipe(
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 @@ -110,7 +110,7 @@ export class TuiHintComponent<C = any> {
@HostListener('document:click', ['$event.target'])
onClick(target: HTMLElement): void {
if (
(!this.el.nativeElement.contains(target) &&
(!target.closest('tui-hint') &&
!this.hover.el.nativeElement.contains(target)) ||
tuiIsObscured(this.hover.el.nativeElement)
) {
Expand Down
14 changes: 14 additions & 0 deletions projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,18 @@ test.describe('Dropdown', () => {
await page.locator('tui-dropdown').locator('tui-scrollbar .t-thumb').click();
await expect(page).toHaveScreenshot('11-dropdown.png');
});

test('Dropdown selection', async ({page}) => {
await tuiGoto(page, '/directives/dropdown-selection');

const textarea = new TuiDocumentationPagePO(page)
.getExample('#textarea')
.locator('textarea');

await textarea.clear();
await textarea.press('@');
await textarea.press('Backspace');

await expect(page.locator('tui-dropdown')).not.toBeVisible();
});
});
1 change: 1 addition & 0 deletions projects/kit/components/input-tag/input-tag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ export class TuiInputTagComponent

event.preventDefault();
this.focusInput();
this.scrollTo();
}

onFieldKeyDownBackspace(event: Event): void {
Expand Down

0 comments on commit 30c3506

Please sign in to comment.