Skip to content

Commit fe386b8

Browse files
authored
Merge pull request #1218 from julien/issue/1215
Fix toolbar location for images
2 parents bc2df3a + 6b1913a commit fe386b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/ui/react/src/selections/selection-position.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,15 @@
5959
payload.editorEvent.data.selectionData : null;
6060

6161
if (selectionData && selectionData.element) {
62-
centerToolbar(this, selectionData.element.getClientRect());
62+
var nativeEditor = payload.editor.get('nativeEditor');
63+
var uiNode = nativeEditor.config.uiNode;
6364

65+
var scrollTop = uiNode ? uiNode.scrollTop : 0;
66+
67+
var rect = selectionData.element.getClientRect();
68+
rect.top += scrollTop;
69+
70+
centerToolbar(this, rect);
6471
return true;
6572
}
6673
};
@@ -92,4 +99,4 @@
9299
image: imageSelectionSetPosition,
93100
table: tableSelectionSetPosition
94101
};
95-
}());
102+
}());

0 commit comments

Comments
 (0)