Can't select a single block
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start with the setSelection API described in the linked cursor-selections documentation and reproduce the issue using identical startBlock and endBlock IDs. Check the related setTextCursorPosition behavior and ensure selecting one block works from its start through its end without throwing; verify the custom SideMenu and FormattingToolbar use case through editor.getSelection().
索引モデルが issue の本文から書いたものです。
説明
What’s broken?
It is not possible to select a single block via the setSelection function or seemingly any other way. Passing the same block or block id throws the error:
Attempting to set selection with the same anchor and head blocks (id ${startBlockId}).
The following also does not set the selection for the given block:
editor.setTextCursorPosition(block.id, "start");
editor.focus();
What did you expect to happen?
editor.setSelection(block.id); or editor.setSelection(block.id, block.id); should select a single block from its start to its end.
Steps to reproduce
- Using the setSelection function pass it the same block id for the
startBlockandendBlock. - The error is thrown, rather than the block being selected from beginning to end.
BlockNote version
0.47.1
Environment
React 18.2
Additional context
I'm currently trying to build a custom SideMenu button that on click selects the corresponding block and opens a custom FormattingToolbar that uses editor.getSelection().
Contribution
- I'd be interested in contributing a fix for this issue
Sponsor
- I'm a sponsor and would appreciate if you could look into this sooner than later 💖
- 主要言語
- TypeScript
- スター
- 10.2k
- フォーク
- 772
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 17
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TypeCellOS/BlockNote のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TypeCellOS/BlockNote#3098 ·
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TypeCellOS/BlockNote#3073 ·
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
TypeCellOS/BlockNote#3072 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TypeCellOS/BlockNote#2949 · コメント 1 件 ·
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TypeCellOS/BlockNote#2855 ·
TypeCellOS/BlockNote の issue をすべて見る
似ている issue
-
Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenNSW/nsw-srilanka#497 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
digidem/comapeo-cloud-app#403 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100