-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pusedoEditableElement's position
- Loading branch information
SAYAN BAKSHI
committed
May 15, 2024
1 parent
821b341
commit 0987d48
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0987d48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, top and left gave values based on the viewport, i.e relative to the canvas.
However the psuedoEditableElement is being pushed into the visual-editor__container, which is inside the body of the client app. Now putting the position absolute to its parent, that is the editor container, we get the psuedoEditableElement in the wrong position.
To fix this, we can use the offsetTop and offsetLeft to get the editableElement's absolute position and use that instead to properly render over the div.