@marijn I’ve got multi-selections working by subclassing Selection. But now I’m trying to implement a drag selection similar to Notion.
The tricky thing is that if you don’t select across any blocks, then there’s “no selection”. I remember seeing mention of this in some older threads, but I’m curious how you think I might implement this kind of “no selection” behavior.
My plan is that when holding the meta key, you get a rectangular selection area that selects nodes who’s rects intersect with the selection. However, it’s totally possible to start your selection in the margin of the document and never intersect with a node’s rect…
If I choose something arbitrary like placing the cursor at position 0, then I’d still have to override behaviors for things like Delete. And if we allow for arbitrary “none” selections, then we’d introduce a bunch of runtime errors expecting state.selection.$from
to be defined…