Closed Inveth closed 5 years ago
@Inveth Chrome 70 introduced a breaking change where directly passing html in url will break and needs to be passed after calling encodeURIComponent()
. This version was merged as part of https://github.com/seekshiva/react-native-remote-svg/pull/33.
It looks like the default browser in your device still expects html to be passed directly but encodeURIComponent()
gets called instead. I'm guessing this must be in android. Can you check and tell what the default browser in your device is, and what version it is running?
hi, @seekshiva , I have faced the same issue on android today. my default browser is chrome, v74
@kuzkokov did you manage to resolve the issue. I'm having the same problem.
It looks like the issue may be happening because the uri string provided contains newline character in it, and that messes up the svg when we do encodeURIComponent()
. Can you try removing the newline and see if it works? I can provide a fix accordingly.
@seekshiva made some research.
Funny thing, chrome team fixed that issue as mentioned here and here (in this very repository 😄), so now encodeURIComponent()
just breaking things.
There is still this issue appeared if I remove encodeURIComponent()
from the source code.
@kuzkokov the scrollbar issue can be fixed by providing overflow: hidden;
as style to the html or body generated by SvgImage
. Would it be safe to remove encodeURIComponent()
otherwise?
@seekshiva it seems so. It's only needed if a user has a broken version of chrome, which is from 72 to 72.0.3626.105.
I've published v2.0.5 that reverts the use of encodeURIComponent as well as adds overflow: hidden;
to body (html tag already had overflow: hidden) - show hopefully the scrollbar goes away now. Please check and let me know if scrollbar is gone after the update.
@seekshiva unfortunately, it didn't help.
I made a pull request, fixing it. In the separate react-native-webview
there are props for this purpose. I also added style for html, body
since I faced a problem that svgs was cropping on android, because html content was bigger than WebView
itself somehow.
Please check it. Now it's working fine (for me at least 😄).
Good catch with showsHorizontalScrollIndicator
and showsVerticalScrollIndicator
. I've pushed v2.0.6 with your PR.
@Inveth The above update should solve your issue. Please re-open this issue if you still see the scrollview.
I've tried to use it to render remote SVG images but instead of it it's rendering text :
package.json
What could be the issue here? Is there any conflicts between my packages? I tried to use remote images / local ones and well, just used an example. Same issue all the on all of those.