From 6658412f8bd6688b443e790aa506e3f90ef353bd Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Fri, 23 Jan 2026 02:04:11 +0100 Subject: [PATCH] fixes #2539, show all possible font weight options for local fonts or unknown fontFamily --- src/components/typography/combobox.tsx | 12 ++++++++++-- src/components/ui/combobox.tsx | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/typography/combobox.tsx b/src/components/typography/combobox.tsx index ed937573d..2438fe7d7 100644 --- a/src/components/typography/combobox.tsx +++ b/src/components/typography/combobox.tsx @@ -63,9 +63,17 @@ type FontWeightComboboxProps = Omit & { fontFa export function FontWeightCombobox({ fontFamily, ...props }: FontWeightComboboxProps) { const options = useMemo(() => { const fontData = webFontMap.get(fontFamily); - if (!fontData || !Array.isArray(fontData.weights)) return []; - return fontData.weights.map((variant: string) => ({ + let weights: string[] = []; + + if (!fontData || !Array.isArray(fontData.weights)) { + // Provide all possible options for local fonts or unknown fontFamily + weights = ["100", "200", "300", "400", "500", "600", "700", "800", "900"]; + } else { + weights = fontData.weights as string[]; + } + + return weights.map((variant: string) => ({ value: variant, label: variant, keywords: [variant], diff --git a/src/components/ui/combobox.tsx b/src/components/ui/combobox.tsx index d74478b06..1cd1f9fc1 100644 --- a/src/components/ui/combobox.tsx +++ b/src/components/ui/combobox.tsx @@ -117,11 +117,10 @@ function Combobox({