Skip to content

Commit dd4ae10

Browse files
committed
fix: truncate long labels in CSS value input autocomplete (#5692)
## 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
1 parent 6655af5 commit dd4ae10

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
Box,
3+
Text,
34
useCombobox,
45
ComboboxRoot,
56
ComboboxContent,
@@ -960,12 +961,17 @@ export const CssValueInput = ({
960961
{(() => {
961962
const label = itemToString(item);
962963
const colorValue = getItemColor(item);
964+
const labelElement = (
965+
<Text truncate css={{ maxWidth: theme.spacing[30] }}>
966+
{label}
967+
</Text>
968+
);
963969
if (colorValue === undefined) {
964-
return label;
970+
return labelElement;
965971
}
966972
return (
967973
<Flex justify="between" align="center" grow gap={2}>
968-
<Box>{label}</Box>
974+
{labelElement}
969975
<ColorThumb color={colorValue} />
970976
</Flex>
971977
);

0 commit comments

Comments
 (0)