Skip to content

Commit

Permalink
Merge pull request #14 from Typeform/fix/multiline-selection
Browse files Browse the repository at this point in the history
fix: Multiline selection fix
  • Loading branch information
mumpo authored Nov 25, 2020
2 parents b0e86f6 + 8e819c3 commit df69603
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions themes/bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BubbleTooltip extends BaseTooltip {
setTimeout(() => {
if (this.root.classList.contains('ql-hidden')) return;
const range = this.quill.getSelection();
if (range != null) {
if (range != null && range.length > 0) {
const rangePosition = this.calculateRangePosition(range);
this.position(rangePosition);
}
Expand All @@ -62,7 +62,7 @@ class BubbleTooltip extends BaseTooltip {

calculateRangePosition(range) {
const lines = this.quill.getLines(range.index, range.length);
if (lines.length === 1) {
if (lines.length < 2) {
return this.quill.getBounds(range);
}

Expand Down

0 comments on commit df69603

Please sign in to comment.