Enhancements to editor auto-position
This commit is contained in:
parent
28b8c33f9b
commit
4fa1e145f5
|
@ -32,6 +32,14 @@ const setPosition = (wrapperEl, editorEl, selectedEl) => {
|
|||
editorEl.style.top = 'auto';
|
||||
editorEl.style.bottom = `${containerHeight - annotationTop}px`;
|
||||
}
|
||||
|
||||
// Check if vertical flipping helped, push down if not
|
||||
const currentOrientation = editorEl.children[1].getBoundingClientRect();
|
||||
if (currentOrientation.top < 0) {
|
||||
editorEl.style.top = `${-containerBounds.top}px`;
|
||||
editorEl.style.bottom = 'auto';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default setPosition;
|
||||
|
|
Loading…
Reference in New Issue