Skip to content

fix(tables): select only current cell on Mod-a - #9217

Open
TianHengZhuang wants to merge 1 commit into
nextcloud:mainfrom
TianHengZhuang:fix/table-mod-a-select-cell
Open

TianHengZhuang wants to merge 1 commit into
nextcloud:mainfrom
TianHengZhuang:fix/table-mod-a-select-cell

Conversation

@TianHengZhuang

Copy link
Copy Markdown

Summary

Fixes #5785

Mod-a inside a table cell now selects only that cell's content, matching the existing code-block behaviour. Outside a table the shortcut is declined so document-wide select-all is unchanged.

Approach

Walk up the selection depth to the nearest cell / header_cell and select start(d)..end(d). Mirror of src/nodes/CodeBlock/codeBlockShortcuts.js.

Tests

  • Added unit tests in src/tests/nodes/Table.spec.js for in-cell select and outside-table decline
  • npx vitest run src/tests/nodes/Table.spec.js - 2 new tests pass; 4 pre-existing markdown-serialize failures on main are unrelated

When the caret is inside a table cell, Mod-a now selects that cell's
content instead of the whole document. Outside a table the shortcut
is declined so the default document-wide select-all still applies.

Closes nextcloud#5785

Signed-off-by: TianHengZhuang <39034691+TianHengZhuang@users.noreply.github.com>
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.

Ctrl+A inside table cell should only select all of the cell's content instead of the whole document.

1 participant