Skip to content

Commit

Permalink
fix: correct toolbar position in tables and images when editor is ren…
Browse files Browse the repository at this point in the history
…dered in a modal window

Fixes: https://issues.liferay.com/browse/LPS-128401

Related discussion: https://issues.liferay.com/browse/PTR-2282

Closes: #1466
  • Loading branch information
antonio-ortega committed Mar 3, 2021
1 parent 567e1f7 commit d38889d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/selections/selection-position.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ const centerToolbar = function(toolbar, rect) {
}
}

const scrollTop = uiNode ? uiNode.scrollTop : 0;

const endPosition = [
rect.left + rect.width / 2 - halfNodeWidth - scrollPosition.x,
rect.top +
offsetHeight -
toolbarNode.offsetHeight +
scrollPosition.y -
gutter.top,
gutter.top +
scrollTop,
];

if (endPosition[0] < 0) {
Expand Down

0 comments on commit d38889d

Please sign in to comment.