fix(tables): select only current cell on Mod-a - #9217
Open
TianHengZhuang wants to merge 1 commit into
Open
TianHengZhuang wants to merge 1 commit into
TianHengZhuang wants to merge 1 commit into
Conversation
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>
TianHengZhuang
requested review from
max-nextcloud,
mejo- and
silverkszlo
as code owners
September 17, 2026 08:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5785
Mod-ainside 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_celland selectstart(d)..end(d). Mirror ofsrc/nodes/CodeBlock/codeBlockShortcuts.js.Tests
src/tests/nodes/Table.spec.jsfor in-cell select and outside-table declinenpx vitest run src/tests/nodes/Table.spec.js- 2 new tests pass; 4 pre-existing markdown-serialize failures onmainare unrelated