Skip to content

Commit

Permalink
Fix CharacterStyles position (#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

2 comments on commit 4b8b301

@vercel
Copy link

@vercel vercel bot commented on 4b8b301 Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website-new

lexical.dev
lexical-fbopensource.vercel.app
lexical-git-main-fbopensource.vercel.app
www.lexical.dev
lexicaljs.org
lexicaljs.com

@vercel
Copy link

@vercel vercel bot commented on 4b8b301 Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

playground.lexical.dev
lexical-playground-fbopensource.vercel.app
lexical-playground.vercel.app
lexical-playground-git-main-fbopensource.vercel.app

Please sign in to comment.