Skip to content

Commit

Permalink
fix: add CellSelection support for bubble menu
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed May 6, 2021
1 parent 9399e30 commit 6472d2c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/extension-bubble-menu/src/bubble-menu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ export class BubbleMenuView {
return
}

const {
from,
to,
empty,
$anchor,
} = selection
const { empty, $anchor, ranges } = selection

// support for CellSelections
const from = Math.min(...ranges.map(range => range.$from.pos))
const to = Math.max(...ranges.map(range => range.$to.pos))

// Sometime check for `empty` is not enough.
// Doubleclick an empty paragraph returns a node size of 2.
Expand Down

0 comments on commit 6472d2c

Please sign in to comment.