i used imagesMaxWidth but some of my images can't get windows width
See original GitHub issuesome of my images seems to be largee than my devices screen width here are my codes
<HTML
html={data.content}
imagesMaxWidth={Dimensions.get('window').width}
tagsStyles={ {a: { fontStyle: 'italic', color: '#039BE5',fontWeight: 'bold' } }}
baseFontStyle={{fontSize:15}}
/>
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
i used imagesMaxWidth but some of my images can't ... - GitHub
width and height styles are properly ignored, and imagesMaxWidth works. However, if width and height are supplied as html attributes and not as ......
Read more >How to set imagesMaxWidth when html string already has a ...
Use ignoredStyles prop to ignore width and height of the original pictures. Use ignoredStyles={['height', 'width']} to fix the issue.
Read more >Can't resize pictures so that they will fit my desktop.
I am very upset about this. I used to be able to adjust the size and other things about my pictures before I...
Read more >Images, max-width, and Mobile - David Walsh Blog
Adding img max-width to all images on mobile devices and print medias, you can ensure that images do not exceed maximum device width....
Read more >react-native-render-html-image-resizable - npm
It resizes (and keeps proportions) your images to a maximum width, ensuring that your images won't overflow out of your viewport. A nice...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Exilz it would be nice if you show me the pratical good way to use ignoredStyles since am using it like this
Okay, so it turns out it’s working fine for my on
3.7.0
.<img src="http://placehold.it/250x250" style="width:125px;height:125px;" />
When using these props :
{ ignoredStyles: ['width', 'height'], imagesMaxWidth: 50 }
width
andheight
styles are properly ignored, andimagesMaxWidth
works.However, if
width
andheight
are supplied as html attributes and not as styles, llike this :<img src="http://placehold.it/250x250" style="width:125px;height:125px;" width=125 height=125 />
, the image is displayed in 125 by 125 pixels.This is because
ignoredStyles
only filters styles in thestyle
property.I improved
ignoredStyles
so it also removes all styles added directly through html attributes, too. This should cover all cases.