Applying borderRadius to <Text> ignores backgroundColor
See original GitHub issueDescription
Applying a borderRadius to a <Text> element with a border and a backgroundColor only affects the actual border. The backgroundColor stays square. If this is intended behaviour the documentation has to be changed cause it says <View> style applies to <Text> aswell Text Style but this behaviour does not appear to a <View> element.
example
<Text style={{ backgroundColor: '#f008', borderWidth: 1, borderColor: '#000', borderRadius: 12, padding: 8 }}>Test text</Text>
produces
according to my expectations, backgroundColor should be rounded corners aswell?
Reproduction
Try this snippet to reproduce.
<Text style={{ backgroundColor: '#f008', borderWidth: 1, borderColor: '#000', borderRadius: 12, padding: 8 }}>Test text</Text>
Additional Information
- React Native version: 0.36
- Platform: iOS, don’t know about Android
- Operating System: MacOS
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top Results From Across the Web
React Native Border Radius with background color
Thanks. Yes, putting the backgroundColor and borderRadius on the container, then adding overflow: 'hidden' to the container worked for me ...
Read more >CSS border-radius property - W3Schools
The border-radius property defines the radius of the element's corners. ... Set rounded corners for an element with a background color: #rcorners1 {...
Read more >Incorrect background-color bleeds on cell corners using ...
Set ROW background-color, then target one CELL in ROW and give it a new background-color plus a border-radius:>0. Actual results: The exposed corners...
Read more >How to introduce rounded cells with a background color?
I have seen how to create cells with rounded borders, but is it possible to make a cell that will have no borders,...
Read more >Window.scss Source Code | Ext JS
See also: {@link #$window-ignore-frame-padding}. */. $window-padding: dynamic($panel-frame-padding);. /**. * @var {number}. * The border-radius of Windows.
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
Try overflow=“hidden”, it should help.
I do not understand the logic behind this, a workaround not means a solved bug.
/cc @hramos