BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Selecting blocks without content

Open zeyu2001 opened this issue 11 months ago • 3 comments

Is your feature request related to a problem? Please describe.

The user may want to select a range of blocks, even if they do not contain content (e.g. image blocks).

For instance, the user may wish to delete all of those blocks at the same time. However, this is only possible if the start and end of the selection are blocks with content. In some edge cases, e.g. when using "Ctrl-A" on a document where the first block does not contain content (e.g. an image block), no selection is made, so e.g. "Ctrl-A" + "Ctrl-C", "Ctrl-A" + "Backspace" etc. do not work.

I tried to handle this manually but editor.setSelection requires that both start and end blocks are content blocks.

Describe the solution you'd like

Ideally, it would be nice if editor.setSelection supports all block types. But I'm not sure how well this would work with TipTap so some custom logic to track the selected nodes may be necessary.

I'm happy to look into this more if someone could point me in the right direction :)

zeyu2001 avatar Mar 10 '25 19:03 zeyu2001

Same problem here. It would be nice if BlockNote replicates the select behavior from Notion.

Image

juliomuhlbauer avatar Mar 16 '25 23:03 juliomuhlbauer

Would love this

urjitc avatar Nov 13 '25 22:11 urjitc

We are working on this as part of our "location API", which is being worked on here: https://github.com/TypeCellOS/BlockNote/pull/2044

nperez0111 avatar Nov 19 '25 11:11 nperez0111