fix: add CellSelection support for bubble menu

This commit is contained in:
Philipp Kühn
2021-05-06 09:54:35 +02:00
parent 9399e3061f
commit 6472d2c271

View File

@@ -88,12 +88,11 @@ export class BubbleMenuView {
return return
} }
const { const { empty, $anchor, ranges } = selection
from,
to, // support for CellSelections
empty, const from = Math.min(...ranges.map(range => range.$from.pos))
$anchor, const to = Math.max(...ranges.map(range => range.$to.pos))
} = selection
// Sometime check for `empty` is not enough. // Sometime check for `empty` is not enough.
// Doubleclick an empty paragraph returns a node size of 2. // Doubleclick an empty paragraph returns a node size of 2.