codex-team / codex-team/editor.js

[Bug] Console error when caret events occur without a selectionRange

Open
#1,564 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 13h
Merged PRs (30d)
2

Description

- Drag to create a multi block selection.
- Click somewhere else on the page outside the editor, to remove the browser-native text caret (but not remove the multi-block selection).
- With editorjs focused, press any key.
- The debugger console produces an error in src/components/modules/caret.ts. This is because there is no `selectRange` defined.

Resolution: https://github.com/raykyri/editor.js/commit/223b940be292828dff0dfd0869141c3ba9f03d32

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the multi-block selection and focus steps, then inspect src/components/modules/caret.ts where the console error occurs when no selectRange is defined. Confirm the caret event path handles this state without producing an error, and compare the referenced resolution commit for the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.