Skip to content

Commit 9855751

Browse files
committed
Autofocus new name and add placeholders
1 parent cae284e commit 9855751

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/builder/app/builder/features/settings-panel/resource-panel.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ const SearchParamPair = ({
251251
css={{ gridTemplateColumns: `120px 1fr min-content` }}
252252
>
253253
<InputField
254+
// autofocus only new fields
255+
autoFocus={name === ""}
256+
placeholder="Name"
254257
name="search-param-name"
255258
value={name}
256259
onChange={(event) => onChange(event.target.value, value)}
@@ -263,6 +266,7 @@ const SearchParamPair = ({
263266
/>
264267
<BindingControl>
265268
<InputField
269+
placeholder="Value"
266270
name="search-param-value-literal"
267271
// expressions with variables cannot be edited
268272
disabled={isLiteralExpression(value) === false}
@@ -368,13 +372,17 @@ const HeaderPair = ({
368372
css={{ gridTemplateColumns: `120px 1fr min-content` }}
369373
>
370374
<InputField
375+
// autofocus only new fields
376+
autoFocus={name === ""}
377+
placeholder="Name"
371378
name="header-name"
372379
value={name}
373380
onChange={(event) => onChange(event.target.value, value)}
374381
/>
375382
<input hidden={true} readOnly={true} name="header-value" value={value} />
376383
<BindingControl>
377384
<InputField
385+
placeholder="Value"
378386
name="header-value-validator"
379387
// expressions with variables cannot be edited
380388
disabled={isLiteralExpression(value) === false}

0 commit comments

Comments
 (0)