Skip to content

fix(editor): focus first row when inserting a table via /table - #602

Closed
junereycasuga wants to merge 1 commit into
ZenNotes:mainfrom
junereycasuga:fix/table-focus-first-row
Closed

fix(editor): focus first row when inserting a table via /table#602
junereycasuga wants to merge 1 commit into
ZenNotes:mainfrom
junereycasuga:fix/table-focus-first-row

Conversation

@junereycasuga

@junereycasuga junereycasuga commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #663

When inserting a table with /table, focus now lands in the first header cell instead of being left after the block widget.

Changes:

  • Added focusTableCell(view, tableFrom, row, col) helper in cm-table.ts.
  • Updated /table slash command in cm-slash-commands.ts to focus the first header cell once the widget renders.
  • Updated test in cm-slash-commands.test.ts to assert the first header cell is focused.

Tested:

  • npm run test:run --workspace @zennotes/app-core -- cm-slash-commands.test.ts
  • npm run typecheck --workspace @zennotes/app-core

Before:

Cap.2026-08-15.at.12.00.21.mp4

After:

Cap.2026-08-15.at.11.57.30.mp4

@junereycasuga
junereycasuga force-pushed the fix/table-focus-first-row branch 3 times, most recently from 29ccddc to 9371967 Compare August 20, 2026 08:33
@junereycasuga
junereycasuga force-pushed the fix/table-focus-first-row branch from 9371967 to c36d328 Compare August 21, 2026 05:59
@junereycasuga

Copy link
Copy Markdown
Contributor Author

Closing after getting fixed on the v2.36.0 release branch in 24448dc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/table insert leaves focus inside the first header cell instead of after the table widget

1 participant