Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.65] Fixes Issues with Text backgroundColor #8490

Merged

Conversation

chiaramooney
Copy link
Contributor

@chiaramooney chiaramooney commented Aug 26, 2021

There were two issues with the Text backgroundColor prop:

Changes to the backgroundColor prop on virtual text nodes did not update their corresponding TextHighlighters
Changes to the underlying text did not update the TextHighlighter ranges
This change forces a refresh of all TextHighlighters any time:

A raw text node changes text value
A virtual text node is added or removed from the text tree
A virtual text or root text node updates its backgroundColor prop
TODOs:

Pass inherited foreground color down so virtual text highlighters apply the correct foreground color
Update snapshots since highlighter approach has changed
Produce a before and after video to ensure RNTester TextExample still works as expected
Add examples to RNTester to toggle background colors on RCTText and RCTVirtualText to see highlighter updates working
Add examples to RNTester to remove RCTRawText and RCTVirtualText nodes to see highlighter updates working

Backport #8408 to 0.65.

Microsoft Reviewers: Open in CodeFlow

@chiaramooney chiaramooney requested a review from a team as a code owner August 26, 2021 23:17
@chiaramooney chiaramooney merged commit 668a30a into microsoft:0.65-stable Aug 30, 2021
@chiaramooney chiaramooney deleted the cm-backport-bkg-color branch August 30, 2021 17:05
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