-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
IE11 closest
polyfill with SVG elements
#2900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
closest
polyfill with SVG elements
You could pre-load a more robust polyfill at the top of your project, and the helper utility Using |
Although I do see the polyfill at MDN has been updated: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill And they fallback using We can update our "polyfill" (which isn't really a polyfill, as we don't override the prototype) to use the latest polyfill example from MDN. |
@Alex--C do you know if on IE 11 if an svg.nodeType === Node.ELEMENT_NODE // Node type === 1 |
Since IE11 does not support
Element.prototype.closest
, it falls back to the included polyfill. This polyfill fails ifelement
happens to be an SVG since SVGs do not have theparentElement
property in Internet Explorer. The polyfill then tries to accessundefined.parentElement
.A possible fix would be to use
parentNode
instead ofparentElement
or check whetherelement
is undefined in thedo...while
loop. I don't think that this would break anything, but I don't know enough about the inner workings of bootstrap-vue.The text was updated successfully, but these errors were encountered: