Skip to content

Commit

Permalink
fix(FontFamilyDropdown.tsx): use FontFamily type for event value
Browse files Browse the repository at this point in the history
The event.target.value type was string, but it should be
FontFamily. This change ensures that the correct type is used.
  • Loading branch information
ktun95 committed Feb 14, 2025
1 parent 133b8ad commit 0c162c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor-toolbar/src/components/FontFamilyDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react"
import { Select, MenuItem } from "@material-ui/core"
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext"
import { useAtom } from "jotai"
import { fontFamilyAtom, fonts } from "../context/atomConfigs"
import { fontFamilyAtom, fonts, FontFamily } from "../context/atomConfigs"
import { applyTextStyles } from "../utils/textStyles"
import { useToolbarItemStyles } from "../hooks/useToolbarItemStyles"

Expand All @@ -18,7 +18,7 @@ const FontFamilyDropdown = () => {
const joinedClasses = `${classes.root} ${classes.spaced}`

const onFontFamilySelect = (event: FontFamilySelectProperties) => {
applyTextStyles(editor, { "font-family": event.target.value as string })
applyTextStyles(editor, { "font-family": event.target.value as FontFamily })
}

return (
Expand Down

0 comments on commit 0c162c5

Please sign in to comment.