DOM selection of block nodes

In my project I have some leaf block nodes that are children of the doc-node. Multiple of these can be directly below each other inside the doc. However if that is the case, using “normal text selection” (meaning by pressing and holding down the left mouse button and moving the cursor) you can only select none or all of the leaf block nodes directly adjacent to each other. The problem doesn’t happen when there are paragraphs (even if empty) between those nodes.

I made a minimal example of this here: https://glitch.com/edit/#!/chain-cyclamen There you can see that selecting anything between pos 38 and 43 by the before mentioned “normal text selection” isnt possible.

Is there a way to make leaf block nodes behave nicely with normal text selection?

1 Like

Text selection must start and end on inline positions. This reflects the way DOM selections work—you can’t put the cursor between blocks (and on some browser it even takes a kludge to programatically put a selection end there). So what you’re asking for can’t be done with text selections.

1 Like

Ok I see. Thanks :slight_smile:

Hello, I also encountered the same problem. Have you solved this problem with other methods?