Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

experimental: preserve numeric order in css variables autocomplete (#4227)

Bogdan Chadkin40e9c1e7adad
diff --git a/packages/design-system/src/components/combobox.tsx b/packages/design-system/src/components/combobox.tsx
index 92aeebf6d7..5c2afd6ca9 100644
--- a/packages/design-system/src/components/combobox.tsx
+++ b/packages/design-system/src/components/combobox.tsx
@@ -225,6 +225,10 @@ const defaultMatch = <Item,>(
) =>
matchSorter(items, search, {
keys: [itemToString],
+ baseSort: (left, right) =>
+ left.rankedValue.localeCompare(right.rankedValue, undefined, {
+ numeric: true,
+ }),
});
type ItemToString<Item> = (item: Item | null) => string;