diff --git a/projects/cdk/tokens/active-element.ts b/projects/cdk/tokens/active-element.ts index 12299a665670..20db292c81ee 100644 --- a/projects/cdk/tokens/active-element.ts +++ b/projects/cdk/tokens/active-element.ts @@ -6,6 +6,7 @@ import { tuiCreateTokenFromFactory, tuiGetActualTarget, tuiGetDocumentOrShadowRoot, + tuiIsNativeMouseFocusable, } from '@taiga-ui/cdk/utils'; import type {Observable} from 'rxjs'; import { @@ -34,7 +35,9 @@ function isValidFocusout(target: any, removedElement: Element | null = null): bo // Not due to button/input becoming disabled or under disabled fieldset !target.matches(':disabled') && // Not due to element being removed from DOM - !removedElement?.contains(target) + !removedElement?.contains(target) && + // Not due to scrollable element became non-scrollable + tuiIsNativeMouseFocusable(target) ); }