fix: allow searching css with dash e.g. flex-direction (#4996)

In advanced panel in both search in put and add property autocomplete
right now if you type dash it won't find anything with dash

## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
This commit is contained in:
Oleg Isonen
2025-03-13 18:31:02 +00:00
committed by GitHub
parent af653fa002
commit 973d7d609a
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ const getAutocompleteItems = () => {
};
const matchOrSuggestToCreate = (search: string, items: Array<SearchItem>) => {
const matched = matchSorter(items, search, {
const matched = matchSorter(items, search.replaceAll("-", " "), {
keys: ["key"],
});

View File

@ -389,7 +389,7 @@ export const CssEditor = ({
};
const handleSearch = (event: ChangeEvent<HTMLInputElement>) => {
const search = event.target.value.trim();
const search = event.target.value.trim().replaceAll("-", " ");
if (search === "") {
return handleAbortSearch();
}