Skip to content
Snippets Groups Projects
Commit c86a1533 authored by chris's avatar chris
Browse files

place alt text

parent 62a4a6ff
No related branches found
No related tags found
1 merge request!413Image alt text
......@@ -18,9 +18,12 @@ export default ({ setPosition, position }) => {
useLayoutEffect(() => {
const WaxSurface = activeView.dom.getBoundingClientRect();
console.log(activeView.state.selection);
const left = 300;
const top = 500;
const { selection } = activeView.state;
const imageId = selection.node.attrs.id;
const image = document.querySelector(`[data-id='${imageId}']`);
const imagePosition = image.getBoundingClientRect();
const left = imagePosition.left - WaxSurface.left;
const top = imagePosition.bottom - WaxSurface.top + 10;
setPosition({ ...position, left, top });
}, [position.left]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment