Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: after select font family cant write text (docs and sheets) (#6665)

Roman Sergeevc1f0b717bce0
diff --git a/packages/ui/src/components/font-family/FontFamilyItem.tsx b/packages/ui/src/components/font-family/FontFamilyItem.tsx
index 443e4904b6..9cc500897c 100644
--- a/packages/ui/src/components/font-family/FontFamilyItem.tsx
+++ b/packages/ui/src/components/font-family/FontFamilyItem.tsx
@@ -20,11 +20,13 @@ import { Tooltip } from '@univerjs/design';
import { InfoIcon } from '@univerjs/icons';
import { useEffect, useState } from 'react';
import { IFontService } from '../../services/font.service';
+import { ILayoutService } from '../../services/layout/layout.service';
import { useDependency } from '../../utils/di';
export const FontFamilyItem = ({ id, value }: { id: string; value: string }) => {
const commandService = useDependency(ICommandService);
const fontService = useDependency(IFontService);
+ const layoutService = useDependency(ILayoutService);
const [fonts, setFonts] = useState<IFontConfig[]>([]);
@@ -41,6 +43,7 @@ export const FontFamilyItem = ({ id, value }: { id: string; value: string }) =>
const localeService = useDependency(LocaleService);
function handleSelectFont(value: string) {
+ layoutService.focus();
commandService.executeCommand(id, { value });
}