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

fix(fabric): cherry-pick some View related fixes #2281

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

Saadnajmi
Copy link
Collaborator

Summary:

This is part of a series of PRs where we are cherry-picking fixes from #2117 to update our Fabric implementation on macOS.

These particular fixes looked to be easy low hanging fruit.

Test Plan:

CI should pass

Nick Lefever added 2 commits November 14, 2024 21:03
…Component

Summary:
Hit testing in RN macOS uses the view coordinate space instead of the macOS superview coordinate space. The RCTView hitTest implementation gets called from Fabric when Paper components are loaded through the `LegacyViewManagerInteropComponent`.

When the Paper component has Fabric child components, the hitTest implementation would treat those as native macOS views.

This diff adds a selector check to detect Fabric RCTViewComponentView instances and apply the right point conversion. The selector check allows to have the right behavior without having to import Fabric classes in Paper code.

Test Plan:
- Run Workplace Chat with Fabric enabled
- Click on a thread title in the thread list
- With the fix, the thread gets selected

Reviewers: shawndempsey, ericroz, chpurrer, #rn-desktop

Reviewed By: shawndempsey, ericroz

Differential Revision: https://phabricator.intern.facebook.com/D49083593

Tasks: T163162857
Summary: This diff conditionally sets the CALayer masksToBounds based on the clipsToBounds RN property so that the content of the view would be clipped by the view border.

Test Plan:
- Run Zeratul with Fabric enabled
- Check that the profile pictures with no status indicator are clipped by the half size border radius set on the parent view.

| Before | After |
|--|
|  {F1090251649}  |  {F1090249259}  |

Reviewers: shawndempsey, chpurrer, #rn-desktop

Reviewed By: chpurrer

Differential Revision: https://phabricator.intern.facebook.com/D49239973
@Saadnajmi Saadnajmi requested a review from a team as a code owner November 15, 2024 03:08
…er components

Summary: The tag value is stored in the `reactTag` property on macOS. The adapter used by the RCTLegacyViewManagerInteropComponentView was being provided the `tag` property value which set all interceptors to tag -1 leading to incorrect event dispatching on the JS side.

Test Plan:
- Open the settings pane in Zeratul and select the appearance tab.
- Toggle the theme PopUpButton

With the fix, the theme changes while before the zoom would change.
 https://pxl.cl/3vZRd

Reviewers: shawndempsey, #rn-desktop

Reviewed By: shawndempsey

Differential Revision: https://phabricator.intern.facebook.com/D49897662
@Saadnajmi Saadnajmi changed the title fix(fabric): cherry-pick fixes related to RCTView / RCTComponentView / RCTLegacyViewManagerInteropComponentView fix(fabric): cherry-pick some view related fixes Nov 15, 2024
@Saadnajmi Saadnajmi changed the title fix(fabric): cherry-pick some view related fixes fix(fabric): cherry-pick some View related fixes Nov 15, 2024
@Saadnajmi Saadnajmi merged commit 57fc114 into microsoft:main Nov 15, 2024
14 checks passed
@Saadnajmi Saadnajmi deleted the fabric/interop branch November 15, 2024 22:54
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.

2 participants