Skip to content

Commit 2abc520

Browse files
committed
fix jumping of local style source when editing text on a token
1 parent 10b7f06 commit 2abc520

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

apps/builder/app/builder/features/style-panel/style-source/style-source-input.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -204,28 +204,26 @@ const TextFieldBase: ForwardRefRenderFunction<
204204
onKeyDown={onKeyDown}
205205
>
206206
{/* We want input to be the first element in DOM so it receives the focus first */}
207-
{editingItemId === undefined && (
208-
<InputField
209-
{...textFieldProps}
210-
variant="chromeless"
211-
css={{
212-
fontVariantNumeric: "tabular-nums",
213-
lineHeight: 1,
214-
order: 1,
215-
flex: 1,
216-
"&:focus-within, &:hover": {
217-
borderColor: "transparent",
218-
},
219-
}}
220-
size="1"
221-
value={label}
222-
onClick={onClick}
223-
ref={inputRef}
224-
inputRef={internalInputRef}
225-
spellCheck={false}
226-
aria-label="New Style Source Input"
227-
/>
228-
)}
207+
<InputField
208+
{...textFieldProps}
209+
variant="chromeless"
210+
css={{
211+
fontVariantNumeric: "tabular-nums",
212+
lineHeight: 1,
213+
order: 1,
214+
flex: 1,
215+
"&:focus-within, &:hover": {
216+
borderColor: "transparent",
217+
},
218+
}}
219+
size="1"
220+
value={label}
221+
onClick={onClick}
222+
ref={inputRef}
223+
inputRef={internalInputRef}
224+
spellCheck={false}
225+
aria-label="New Style Source Input"
226+
/>
229227
{value.map((item) => (
230228
<StyleSourceControl
231229
key={item.id}

0 commit comments

Comments
 (0)