Fix for possible infinite looping in MSIE

master v1.0.11
Vitaliy Filippov 2019-07-19 21:05:42 +03:00
parent d6dc215d06
commit 24b12584d0
2 changed files with 5 additions and 2 deletions

View File

@ -111,7 +111,10 @@ export class VirtualScrollList extends React.Component
const e = ReactDOM.findDOMNode(this.itemRefs[index]);
if (e)
{
return e.getBoundingClientRect().height;
// MSIE sometimes manages to report non-integer element heights for elements of an integer height...
// Non-integer element sizes are allowed in getBoundingClientRect, one notable example of them
// are collapsed table borders. But we still ignore less than 1/100 of a pixel difference.
return Math.round(e.getBoundingClientRect().height*100)/100;
}
}
return 0;

View File

@ -1,6 +1,6 @@
{
"name": "dynamic-virtual-scroll",
"version": "1.0.10",
"version": "1.0.11",
"author": {
"name": "Vitaliy Filippov",
"email": "vitalif@yourcmc.ru",