Open raphael22 opened 9 years ago
@raphael22 can you provide a working example?
Almost the same thing here... but it returns null...
It happened inside a modal with 2 iframes (tabs), one was hidden. It's due to known bug: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
In these cases window.getComputedStyle returns null, so this code on line 1699 breaks:
if (window.getComputedStyle)
jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + 'px';
else
jack.style.left = parseInt(switcher.currentStyle['width']) - parseInt(jack.currentStyle['width']) + 'px';
quick workaround:
if (window.getComputedStyle) {
if ( ! window.getComputedStyle(switcher) ) {
jack.style.left = '20px';
} else {
jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + 'px';
}
}
not pretty though
Hi,
got a issue with checked switch in a modal window,
computed width is "50px" not "20px" as usual.
I quick-fix it but it's not a solution