Skip to content

Commit aa413a4

Browse files
committed
fix(table): suppress auto-opened tag dropdown when Enter advances cells
Focusing an empty cell auto-opens the tag dropdown; without closing it a follow-up Enter inserts a tag instead of navigating down the column.
1 parent 79828f4 commit aa413a4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table/table.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ function TableCell({
103103
* while a tag/env-var dropdown is open (Enter selects an option there) or
104104
* during IME composition. The next row already exists — it auto-appends the
105105
* moment the last row is typed into — so focus lands on a real input.
106+
*
107+
* Focusing an empty cell auto-opens the tag dropdown, so the destination's
108+
* dropdown is closed right after focusing: otherwise a follow-up Enter would
109+
* land on that dropdown and insert a tag instead of continuing down the
110+
* column. Clicking or typing `<` in the cell still opens it deliberately.
106111
*/
107112
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
108113
handlers.onKeyDown(e)
@@ -115,10 +120,12 @@ function TableCell({
115120
) {
116121
return
117122
}
118-
const nextInput = inputRefs.current.get(`${rowIndex + 1}-${column}`)
123+
const nextCellKey = `${rowIndex + 1}-${column}`
124+
const nextInput = inputRefs.current.get(nextCellKey)
119125
if (nextInput) {
120126
e.preventDefault()
121127
nextInput.focus()
128+
inputController.fieldHelpers.hideFieldDropdowns(nextCellKey)
122129
}
123130
}
124131

0 commit comments

Comments
 (0)