Skip to content

Commit

Permalink
fix(addon-mobile): DropdownMobile fix cleaner buttons (#7358)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed May 8, 2024
1 parent f695179 commit 8c5ed8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';
import {
TuiActiveZoneDirective,
tuiGetNativeFocused,
tuiIsElement,
tuiIsNodeIn,
tuiPx,
TuiSwipe,
} from '@taiga-ui/cdk';
Expand Down Expand Up @@ -73,7 +75,14 @@ export class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {
}

onClick(event: MouseEvent): void {
if (!this.el.nativeElement.contains(event.target as Node)) {
if (
!this.el.nativeElement.contains(event.target as Node) &&
// TODO: find a better way to check if the click is inside interactive element in textfield
!(
tuiIsNodeIn(event.target as Node, 'tui-svg') ||
(tuiIsElement(event.target) && event.target.tagName === 'button')
)
) {
event.stopPropagation();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<tui-combo-box
tuiDropdownMobile
[tuiTextfieldCleaner]="true"
[(ngModel)]="country"
>
Country
Expand Down Expand Up @@ -28,6 +29,7 @@
tuiDropdownMobile
class="tui-space_vertical-4"
[stringify]="stringify"
[tuiTextfieldCleaner]="true"
[(ngModel)]="selected"
[(tuiDropdownOpen)]="open"
>
Expand Down

0 comments on commit 8c5ed8b

Please sign in to comment.