Skip to content

Commit 1ec5a57

Browse files
committed
fix: prevent measurement jitter when scale is applied
1 parent dd5b49a commit 1ec5a57

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/virtual-core/src/index.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,8 @@ export const measureElement = <TItemElement extends Element>(
251251
return size
252252
}
253253
}
254-
return Math.round(
255-
element.getBoundingClientRect()[
256-
instance.options.horizontal ? 'width' : 'height'
257-
],
258-
)
254+
255+
return (element as unknown as HTMLElement)[instance.options.horizontal ? 'offsetWidth' : 'offsetHeight']
259256
}
260257

261258
export const windowScroll = <T extends Window>(

0 commit comments

Comments
 (0)