Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct annotation overlay size #128

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/pages/content/drawLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ styleElem.innerHTML = `
z-index: 99999999;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
right: 0;
bottom: 0;
margin: 0;
padding: 0;
background: unset;
border: none;
}
Expand Down Expand Up @@ -311,8 +313,11 @@ export function addLabelsToDom(data: LabelDataWithElement[]) {
data.forEach(({ element, label }, index) => {
drawLabel(wrapper, element, label, baseZIndex + data.length - index);
});
document.body.appendChild(wrapper);
// this does not exist on Firefox yet
// set wrapper's width and height to match body
wrapper.style.width = `${document.documentElement.scrollWidth}px`;
wrapper.style.height = `${document.documentElement.scrollHeight}px`;
document.documentElement.appendChild(wrapper);
// this method does not exist on Firefox yet (this code only runs on Chrome, but just in case)
wrapper.togglePopover && wrapper.togglePopover();
}

Expand Down
Loading