angular-dynamic-layout
angular-dynamic-layout copied to clipboard
IE handling of getBoundingClientRect() is unpredictable
Was just noticing even the latest IEs have some strange values calculated for var rect = elements[i].children[0].getBoundingClientRect(); (L51)
Basically with all equal-percentage-width items, I was getting a range of 346.6299743652344 - 346.6300048828125 after the the layout had been changed once with a dynamicLayout.layout event.
This then went on cause some havoc with items[i].columnSpan = Math.ceil(items[i].width / colSize); L308
In my testing, getting the width number down to 3 decimal places (x.toFixed(3)) was the magic number for allowing IE to function and other browsers to fit items into the container width.
Another option would be to rethink the Math.ceil call mentioned above.