facebook / facebook/lexical

Feature Support for non-contiguous table cell selection (multi-select with Cmd/Ctrl+Click)

Open
#7,976 1 comment 0 reactions 0 assignees View on GitHub
enhancement tables
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
57

Description

## Description
Hello! I would like to request support for non-contiguous table cell selection in Lexical tables, similar to the functionality available in spreadsheet applications like Excel, Google Sheets, and Drobbox Paper

Currently, the TableSelection model only supports rectangular/contiguous selections defined by a bounding box (fromX, toX, fromY, toY). This means users cannot select multiple non-adjacent rows or columns using modifier keys (Cmd/Ctrl+Click).

### Use cases
- Bulk formatting: Users want to apply the same formatting (background color, text style) to multiple non-adjacent rows/columns
- Data operations: Delete, copy, or move multiple non-contiguous rows/columns at once
- Table reorganization: Select specific rows scattered throughout a table for bulk operations
- Improved UX parity: Matches user expectations from Excel, Google Sheets, Paper, etc.

### Context / considerations
- May require extending the TableSelection class to store an array of selected cell ranges rather than a single bounding box
- Would need updates to selection rendering/highlighting to support non-contiguous cells
- Commands that operate on selections would need to handle non-rectangular selections

| Sheets | Paper |
|--------|--------|
| Image | Image |

## Impact
- Any users working with tables in Lexical-based editors
- Applications that need spreadsheet-like functionality (data tables, planning tools, CMS systems)
- This would be used regularly by power users working with data-heavy tables
- Particularly valuable in collaborative editing tools, project management apps, and document editors with complex tables

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.