fix: adjust for wrapper offset before deciding toolbar orientation

This commit is contained in:
Sabrina Mack 2023-09-12 22:54:58 -07:00
parent f7d3754421
commit 643205f0b5

View file

@ -191,12 +191,12 @@ export default class InlineToolbar extends Module<InlineToolbarNodes> {
*/
this.nodes.wrapper.classList.toggle(
this.CSS.inlineToolbarLeftOriented,
realLeftCoord < this.Editor.UI.contentRect.left
realLeftCoord < this.Editor.UI.contentRect.left - wrapperOffset.x
);
this.nodes.wrapper.classList.toggle(
this.CSS.inlineToolbarRightOriented,
realRightCoord > this.Editor.UI.contentRect.right
realRightCoord > this.Editor.UI.contentRect.right - wrapperOffset.x
);
this.nodes.wrapper.style.left = Math.floor(newCoords.x) + 'px';