Closed demedos closed 3 years ago
@demedos This is expected. You should provide contentWidth
prop to HTML
component. Quoting from the docs here: https://github.com/meliorence/react-native-render-html#props
contentWidth: The width of the HTML content to display. If you don't pass this prop, images might overflow horizontally and take up to all their physical width. The recommended practice is to pass useWindowDimensions().width minus any padding or margins.
@jsamr Duh, I haven't read the prop description on the docs. Thank you.
@demedos No worries :-) happy coding!
@jsamr I was wondering though, when the renderer was integrated into react-native-renderer-html
the width of the content was calculated automatically, which was quite handy because my paddings are dynamic. Is there any way to replicate the old behaviour?
@demedos If I understood your requirement well, this feature is available in v6 (foundry release)! Yet in alpha, but very soon the API be frozen and beta-released with a brand new doc website! See https://github.com/meliorence/react-native-render-html/issues/430
Oath
I swear that I have completed these tasks before submitting:
Bug Report
Content doesn't scale to fit if the container has some padding
Environment
React Native
Libraries
Devices
Reproduction
Render a component with some padding around the iframe
Description
Expected output: the iframe scales to fit its container Observed output: the iframe overflows and some parts are not visible
Reproducible Demo
snack: https://snack.expo.io/AfrVZoTgW (just check the code, iframes won't display on the website)