Skip to content

Commit

Permalink
Fix CharacterStyles position (facebook#2041)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Apr 29, 2022
1 parent 0e664aa commit 4b8b301
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function setPopupPosition(
let top = rect.top - 8 + window.pageYOffset;
let left =
rect.left + 230 + window.pageXOffset - editor.offsetWidth + rect.width;
if (rect.width >= rootElementRect.width - 20) {
if (
rect.width >= rootElementRect.width - 20 ||
left > rootElementRect.width - 150
) {
left = rect.left;
top = rect.top - 50 + window.pageYOffset;
}
Expand Down

0 comments on commit 4b8b301

Please sign in to comment.