Skip to content

fix(macos): <Text> with backgroundColor spills color past it's frame#2401

Merged
Saadnajmi merged 3 commits intomicrosoft:mainfrom
Saadnajmi:text-backgroundcolor
Mar 7, 2025
Merged

fix(macos): <Text> with backgroundColor spills color past it's frame#2401
Saadnajmi merged 3 commits intomicrosoft:mainfrom
Saadnajmi:text-backgroundcolor

Conversation

@Saadnajmi
Copy link
Copy Markdown
Collaborator

Summary:

For some odd reason, if you set backgroundColor on a Text component, the color spills out past the frame to the parent. We can work around this by setting border radius... which somehow prevents this behavior. I need to debug the native side more (and may update this PR with a proper fix if I find one), but for now let's patch the JS to set a dummy value for borderRadius if we create a Text Element with backgroundColor and without borderRadius

Test Plan:

A bunch of examples in RNTester are now visible... like the "Recently Viewed" section.

image

@Saadnajmi Saadnajmi requested a review from a team as a code owner March 6, 2025 22:21
Comment thread packages/react-native/Libraries/Text/Text.js Outdated
@Saadnajmi Saadnajmi enabled auto-merge (squash) March 7, 2025 10:45
@Saadnajmi Saadnajmi merged commit 09fc3b7 into microsoft:main Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants