We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f6144fb + da5f446 commit 5adf8a6Copy full SHA for 5adf8a6
src/ElementQueries.js
@@ -409,9 +409,11 @@
409
410
document.body.addEventListener(animationStart, function (e) {
411
var element = e.target;
412
- var styles = window.getComputedStyle(element, null);
+ var styles = element && window.getComputedStyle(element, null);
413
+ var animationName = styles && styles.getPropertyValue('animation-name');
414
+ var requiresSetup = animationName && (-1 !== animationName.indexOf('element-queries'));
415
- if (-1 !== styles.getPropertyValue('animation-name').indexOf('element-queries')) {
416
+ if (requiresSetup) {
417
element.elementQueriesSensor = new ResizeSensor(element, function () {
418
if (element.elementQueriesSetupInformation) {
419
element.elementQueriesSetupInformation.call();
0 commit comments