facebook / facebook/lexical

Bug: Range selection selects root node while trying to click on the Horizontal Rule

Open
#6,689 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

Lexical version:

## Steps To Reproduce

1. in Lexical playground, insert a `Horizontal Rule` via the insert button
2. click on the left part of the HR in editor but slightly higher, like shown
![image](https://github.com/user-attachments/assets/779a6ed7-41d5-41c3-bdee-5fb26e409d3f)
3. check the debugging panel, selection: range, `root` is selected
![image](https://github.com/user-attachments/assets/c0fe07d5-53c5-484a-88dc-5ed81bc06c56)
4. now press `backspace` will move focus to the first node

Link to code example: N/A
Reproducible on the official playground

## The current behavior

Root is selected

## The expected behavior

Root should not be selected

## Impact of fix

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.