Skip to content

Commit 1d993aa

Browse files
committed
fix(web): autofocus only in worflow node dialog
1 parent 4f18ed8 commit 1d993aa

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/web/src/components/workflow/fields/number-field.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function NumberField({
1212
onChange,
1313
onClear,
1414
value,
15+
autoFocus,
1516
}: FieldProps) {
1617
// Convert to string and check for meaningful value (empty strings are considered "no value")
1718
const stringValue = String(value ?? "");
@@ -29,7 +30,7 @@ export function NumberField({
2930
className={cn(
3031
"rounded-md border border-neutral-300 dark:border-neutral-700"
3132
)}
32-
autoFocus
33+
autoFocus={autoFocus}
3334
/>
3435
{!disabled && clearable && hasValue && (
3536
<ClearButton

apps/web/src/components/workflow/fields/property-field.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface PropertyFieldProps {
5353
disabled?: boolean;
5454
connected?: boolean;
5555
createObjectUrl: (objectReference: ObjectReference) => string;
56+
autoFocus?: boolean;
5657
}
5758

5859
export function PropertyField({
@@ -65,6 +66,7 @@ export function PropertyField({
6566
disabled = false,
6667
connected = false,
6768
createObjectUrl,
69+
autoFocus = false,
6870
}: PropertyFieldProps) {
6971
return (
7072
<div className="text-sm space-y-1">
@@ -124,6 +126,7 @@ export function PropertyField({
124126
connected={connected}
125127
createObjectUrl={createObjectUrl}
126128
className="w-full"
129+
autoFocus={autoFocus}
127130
/>
128131
</div>
129132
</div>

apps/web/src/components/workflow/fields/text-field.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function TextField({
1212
onChange,
1313
onClear,
1414
value,
15+
autoFocus,
1516
}: FieldProps) {
1617
// Convert to string and check for meaningful value (empty strings are considered "no value")
1718
const stringValue = String(value ?? "");
@@ -28,7 +29,7 @@ export function TextField({
2829
"resize-y rounded-md border border-neutral-300 dark:border-neutral-700"
2930
)}
3031
disabled={disabled}
31-
autoFocus
32+
autoFocus={autoFocus}
3233
/>
3334
{!disabled && clearable && hasValue && (
3435
<ClearButton

apps/web/src/components/workflow/fields/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface FieldProps {
1111
disabled?: boolean;
1212
connected?: boolean;
1313
clearable?: boolean;
14+
autoFocus?: boolean;
1415
}
1516

1617
export interface FileFieldProps extends FieldProps {

apps/web/src/components/workflow/workflow-node.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ export const WorkflowNode = memo(
568568
disabled={disabled}
569569
connected={isInputConnected}
570570
createObjectUrl={data.createObjectUrl}
571+
autoFocus
571572
/>
572573
);
573574
})()}

0 commit comments

Comments
 (0)