Uh oh!
There was an error while loading. Please reload this page.
fix(fabric, text): render Text in an NSTextView - #2286
Merged
Saad Najmi (Saadnajmi) merged 3 commits intoNov 28, 2024
Conversation
Saad Najmi (Saadnajmi)
requested review from
Patrick Boyd (PPatBoyd) and Adam Gleitman (amgleitman)November 20, 2024 00:38
Tommy Nguyen (tido64)
approved these changes
Nov 28, 2024
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…yout manager Summary: To render text using an NSTextView, we need to gain access to a fully configured NSTextStorage to configure the text view to render the text with the right configuration. Test Plan: Tested later in this stack. Reviewers: shawndempsey, chpurrer, #rn-desktop Reviewed By: shawndempsey Differential Revision: https://phabricator.intern.facebook.com/D49465173 Tasks: T163838519
Summary: Use an NSTextView to render the text in RCTParagraphComponentView so that we would get UX interactions specific to desktop for free (e.g. text selection)
Test Plan:
- Run Zeratul with Fabric enabled
- Check that text is being rendered correctly with the right size and positioning.
{F1097505779}
Reviewers: shawndempsey, chpurrer, #rn-desktop
Reviewed By: shawndempsey
Differential Revision: https://phabricator.intern.facebook.com/D49465175
Tasks: T163838519Saad Najmi (Saadnajmi)force-pushed
the
fabric/text-rendering
branch
from
November 28, 2024 23:26
05ffc5c to
a06142fCompareSaad Najmi (Saadnajmi)
enabled auto-merge (rebase)
November 28, 2024 23:35
Saad Najmi (Saadnajmi) added a commit
that referenced
this pull request
Sep 10, 2025
## Summary: Revert #2286 There are 3 commits that make Text Selection work via NSTextView on Fabric, but we only ever merged two of them in. The 3rd (currently in #2673 ) is a work-in-progress, as it currently doesn't work. I need to debug why text selection doesn't work, but as it stands, the diffs to render with an NSTextView add more complexity for not much gain without it. I'd rather reland all the commits together and test with an implementation of Text closer to iOS in the meanwhile. ## Test Plan: CI should pass
Saad Najmi (Saadnajmi) added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Sep 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This is part of a series of PRs where we are cherry-picking fixes from #2117 to update our Fabric implementation on macOS.
Cherry pick the first couple of fixes to Text. Notable changes from the initial commits:
NSTextStoragethroughRCTTextLayoutManager. However, since react@840fd30 , that method doesn't exist. So we refactored a bit to add it back.Test Plan:
Launched RNTester and Text seems to render as it did on Paper.