From d60d84a456bf32f6726816ac2e05872336c235f2 Mon Sep 17 00:00:00 2001 From: Tomas Rimkus Date: Wed, 2 Oct 2024 09:59:35 +0200 Subject: [PATCH] chore: editor autofocus fix #2 --- projects/editor/components/editor/editor.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/editor/components/editor/editor.component.ts b/projects/editor/components/editor/editor.component.ts index 45453b0c9..536abe264 100644 --- a/projects/editor/components/editor/editor.component.ts +++ b/projects/editor/components/editor/editor.component.ts @@ -20,6 +20,7 @@ import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER, TuiActiveZone, + tuiAutoFocusOptionsProvider, TuiControl, tuiInjectElement, tuiWatch, @@ -27,6 +28,7 @@ import { } from '@taiga-ui/cdk'; import type {TuiDropdownDirective} from '@taiga-ui/core'; import { + TUI_ANIMATIONS_DEFAULT_DURATION, TUI_APPEARANCE_OPTIONS, TuiAppearance, tuiAppearanceFocus, @@ -81,6 +83,10 @@ import {TuiEditorPortalHost} from './portal/editor-portal-host.component'; provide: TUI_APPEARANCE_OPTIONS, useValue: {appearance: 'textfield'}, }, + tuiAutoFocusOptionsProvider({ + delay: TUI_ANIMATIONS_DEFAULT_DURATION, + query: '[contenteditable].ProseMirror, input:not(.t-image, .t-file-upload), textarea, select', + }), ], hostDirectives: [ {