Skip to content

Commit

Permalink
detect element resize remove listener try/catch for Preact compat
Browse files Browse the repository at this point in the history
For more history see preactjs/preact-compat#228
  • Loading branch information
Brian Vaughn authored and ineentho committed Sep 22, 2017
1 parent 57dd13c commit 5e73aba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion detectElementResize.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ export default function createDetectElementResize () {
);
element.__resizeTriggers__.__animationListener__ = null;
}
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
try {
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
} catch (e) {
// Preact compat; see developit/preact-compat/issues/228
}
}
}
}
Expand Down

0 comments on commit 5e73aba

Please sign in to comment.