Can't select a single block
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 58/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- react, typescript
- Domínio
- frontend
Direção de pesquisa
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().
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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 💖
- Linguagem predominante
- TypeScript
- Estrelas
- 10.2k
- Forks
- 772
- Merge médio
- 6d 21h
- PRs com merge (30d)
- 26
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TypeCellOS/BlockNote
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
TypeCellOS/BlockNote#2949 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
TypeCellOS/BlockNote#2855 ·
Mantenedores costumam responder em até 1 dia
-
a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
TypeCellOS/BlockNote#2829 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
TypeCellOS/BlockNote#2824 ·
Mantenedores costumam responder em até 1 dia
-
a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
TypeCellOS/BlockNote#2811 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TypeCellOS/BlockNote
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
opengovsg/FormSG#10118 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
ai-driven-qa bug claude
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
linagora/twake-calendar-frontend#1434 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Add: MBC kr [Geo-blocked]Abertacheck:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
iptv-org/iptv#52824 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 78/100
jaegertracing/jaeger-ui#4512 ·
Mantenedores costumam responder em até 1 dia
-
area:ide documentation enhancement platform:macos platform:vscode
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
anthropics/claude-code#97389 ·
Mantenedores costumam responder em até 1 dia