Skip to content

Commit df69603

Browse files
authored
Merge pull request #14 from Typeform/fix/multiline-selection
fix: Multiline selection fix
2 parents b0e86f6 + 8e819c3 commit df69603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

themes/bubble.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class BubbleTooltip extends BaseTooltip {
4848
setTimeout(() => {
4949
if (this.root.classList.contains('ql-hidden')) return;
5050
const range = this.quill.getSelection();
51-
if (range != null) {
51+
if (range != null && range.length > 0) {
5252
const rangePosition = this.calculateRangePosition(range);
5353
this.position(rangePosition);
5454
}
@@ -62,7 +62,7 @@ class BubbleTooltip extends BaseTooltip {
6262

6363
calculateRangePosition(range) {
6464
const lines = this.quill.getLines(range.index, range.length);
65-
if (lines.length === 1) {
65+
if (lines.length < 2) {
6666
return this.quill.getBounds(range);
6767
}
6868

0 commit comments

Comments
 (0)