Commit 2ac6ae2
committed
Skip badge overlap mode when editor is not focused
Same root cause as the auto-select guard in `EditableText/Selection`:
slate-react's throttled `selectionchange` listener can sync a clamped
DOM cursor back into `editor.selection` after the user has clicked
away. `BadgeColumn` would then read a non-null `editor.selection`,
`highlightOverlapsSelection` would return true if the synthetic
cursor happened to land in a highlighted range, and the badge would
flip from `dot` to overlap mode without an actual user selection.
Gate `editorSelection` on `ReactEditor.isFocused(editor)` so badges
fall back to dot mode whenever the editor isn't focused.
REDMINE-212611 parent a5b3893 commit 2ac6ae2
1 file changed
Lines changed: 8 additions & 2 deletions
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | | - | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
0 commit comments