Skip to content

Commit 3ba977f

Browse files
committed
fix: include margin and border when calc width
Fixes #19
1 parent c347f3d commit 3ba977f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ async function calcAlign(opt?: {
275275
.querySelector('math-field')
276276
?.shadowRoot?.querySelector('.ML__mathlive')?.scrollWidth
277277
popup = {
278-
width: scrollWidth ? Math.max(popupDefaultWidth, scrollWidth + 50) : popupContent.clientWidth,
278+
width: scrollWidth ? Math.max(popupDefaultWidth, scrollWidth + 50) : popupContent.offsetWidth,
279279
marginLeft: parseStyle(popupContent.style.marginLeft),
280280
marginRight: parseStyle(popupContent.style.marginLeft),
281281
left: parseStyle(popupContent.style.left) + parseInt(popupContent.dataset.dx ?? '0'),

0 commit comments

Comments
 (0)