refactor(helpers): modernize reactive helpers and add tests
This commit is contained in:
@@ -291,7 +291,7 @@ export function createVirtualizer<T>(
|
||||
},
|
||||
};
|
||||
} else {
|
||||
containerHeight = node.offsetHeight;
|
||||
containerHeight = node.clientHeight;
|
||||
|
||||
const handleScroll = () => {
|
||||
scrollOffset = node.scrollTop;
|
||||
|
||||
@@ -56,6 +56,11 @@ function createMockContainer(height = 500, scrollTop = 0): any {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(container, 'clientHeight', {
|
||||
value: height,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(container, 'scrollTop', {
|
||||
value: scrollTop,
|
||||
writable: true,
|
||||
|
||||
Reference in New Issue
Block a user