-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Polyfill makes changes to the DOM beyond the image editor component #706
Comments
@cgratie |
@lja1018 |
@cgratie |
Describe the bug
The
svgxuse
polyfill makes changes to all the<use>
tags in the document. This can break other functionality when the image editor is integrated into a larger project. It is also not compatible with React, because the DOM changes are likely to interfere with the reconciliation algorithm.In my specific case this also creates a bug: SVG sprites used outside of the image editor are not loading in certain cases.
To Reproduce
1.
import ImageEditor from '@toast-ui/react-image-editor';
somewhere inside a CRA webapp.2. Somewhere else, use an SVG sprite as
<svg><use href="https://url/of/svg#hash" /><svg>
.3. Start the dev server.
4. In the browser, set network throttling to 3G and reload the page.
5. The SVG sprite will not load. In the inspector we can also see that the
href
attribute has been overwritten to hold only"#hash"
.Expected behavior
Desktop (please complete the following information):
Additional context
In my project I have confirmed that the issue is directly related to this polyfill by editing the corresponding file to remove it.
I am also able to "disable" the polyfill with the following aggressive workaround:
The text was updated successfully, but these errors were encountered: