Comments (5)
@Naxus28 Thanks for your submission! To help you out I would need to know:
- the version of the plugin
- version of react-native-render-html
- version of react-native-webview
- an HTML snippet allowing me to reproduce the issue locally
thanks!
from plugins.
Hey there @jsamr. Other than that everything works smoothly. Thanks for the library. Here you go:
• the version of the plugin: "@native-html/iframe-plugin": "^1.1.2",
• version of react-native-render-html: "react-native-render-html": "^5.0.1",
• version of react-native-webview: "react-native-webview": "^11.2.5",
• an HTML snippet allowing me to reproduce the issue locally:
const iframes = `
<section>
<iframe width="560" height="315" src="https://www.youtube.com/embed/mNz6eHfsESQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p style="text-align:center;"><em>Skeletor's Best Insults; enjoy</em></p>
</section>
`;
Please let me know if this works.
Thanks!
from plugins.
@Naxus28 You should use contentWidth
prop of react-native-render-html
. Here is the fix:
@@ -18,11 +18,6 @@ export default function App() {
iframe,
},
WebView,
- defaultWebViewProps: {
- containerStyle: {
- width: contentWidth - 40,
- },
- },
ignoredTags: IGNORED_TAGS,
renderersProps: {
iframe: {
@@ -38,7 +33,7 @@ export default function App() {
return (
<ScrollView style={styles.container}>
- <HTML source={{html}} {...htmlConfig} />
+ <HTML source={{html}} contentWidth={contentWidth - 40} {...htmlConfig} />
</ScrollView>
);
}
Tell me if that works out for you.
from plugins.
Nice! That fixed it. I have to keep defaultWebViewProps.containerStyle.width
though because I am also supporting tables, which won't display if defaultWebViewProps.containerStyle.width
is not set. Not sure that is the desired behavior but that is how it is working now.
from plugins.
@Naxus28 interesting; if you find the time for a reproduction I'll welcome it! Closing now as your issue looks addressed :-)
from plugins.
Related Issues (20)
- img tag is not supported inside table HOT 11
- Works fine for iOS but breaking in PWA HOT 9
- Are the table heights synchronized? If they are, how to disable syncing? HOT 6
- [table-plugin] Set text-align in tableStyleSpecs HOT 3
- undefinded is not a function (near '...(0,_reactNativeRenderHtml.domNodeToHTMLString)...') HOT 3
- i got error on back press please resolve it, thanks HOT 2
- If you get an error, read this first
- [iframe] Video always autoplay. How to disable autoplay? HOT 1
- [heuristic-table-plugin]table-row/collum styling HOT 4
- [iframe-plugin] Content doesn't scale to fit if the container has some padding HOT 5
- Table not showing HOT 2
- [heuristic-table-plugin] forceStretch causes crash HOT 4
- [iframe-plugin] Add an option to add headers to the webview HOT 2
- [iframe-plugin] html string with iframe, iframe will not work HOT 8
- [heuristic-table-plugin] Text not showing when using tableRenderers
- [table-plugin] Android app (expo go and production) crashes for certain html content HOT 2
- [iframe-plugin] Crashes on Android when using certain content. HOT 4
- [iframe-plugin] html string with iframe, iframe will not work. Tried the solution in issue #41 but the app crashes
- borderwidth not showing in right side and bottom side in Table. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugins.