Feature: make CreateRangeSelection meaningful
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 61
Description
Currently, the `$createRangeSelection` function trivially select the first position [see here](https://github.com/facebook/lexical/blob/14554bf94d20405d27efcfe4dcaf457a3db4457f/packages/lexical/src/LexicalSelection.ts#L2250). If it is the intended behavior, I suggest the naming to be changed to `$selectFirstPosition`.
To me, I believe `$createRangeSelection` should accept couple of options that specifies the key, type and offset for both anchor and focus, to make it more flexible and useful.
If there's another way to create a rangeSelection, please kindly instruct me. Thank you.
Contributor guide
Research direction
Start at packages/lexical/src/LexicalSelection.ts around line 2250 and inspect $createRangeSelection. Clarify whether the intended change is renaming it to $selectFirstPosition or adding key, type, and offset options for both anchor and focus. Done requires an agreed API and defined behavior for creating both positions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100