Closed CoCoManYY closed 4 months ago
复现地址:https://stackblitz.com/edit/react-i9zyca?file=demo.tsx,index.html,package.json
https://github.com/react-component/virtual-list/blob/master/src/List.tsx#L277 这里是不是应该直接消费offsetWidth和offsetHeight? 目前消费的width和height是通过getBoundingClientRect取的,该值为相对视口的宽高,会根据缩放而变化。
offsetWidth
offsetHeight
width
height
getBoundingClientRect
复现地址:https://stackblitz.com/edit/react-i9zyca?file=demo.tsx,index.html,package.json
https://github.com/react-component/virtual-list/blob/master/src/List.tsx#L277 这里是不是应该直接消费
offsetWidth
和offsetHeight
? 目前消费的width
和height
是通过getBoundingClientRect
取的,该值为相对视口的宽高,会根据缩放而变化。