-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Overflow implementation in Fabric as per Parity to Paper #15338
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
Open
Nitin-100
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
Nitin-100:nitin/parity-fabric/overflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
42cd123
Implement overflow property support for Fabric architecture
85b860f
Change files
923467f
Merge branch 'main' into nitin/parity-fabric/overflow
Nitin-100 3359743
Merge branch 'main' into nitin/parity-fabric/overflow
Nitin-100 968d635
Merge branch 'main' into nitin/parity-fabric/overflow
Nitin-100 f68fbe6
Subject: ETW Provider Registration - Route to Existing 1DS Aria Tenant
d82c4dd
Remove overflowTest.tsx - will attach separately in PR
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-8d24c2d8-08f9-4612-a46d-8bf25b0f020d.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Implement overflow property support for Fabric architecture", | ||
| "packageName": "react-native-windows", | ||
| "email": "[email protected]", | ||
| "dependentChangeType": "patch" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1142,6 +1142,21 @@ void ViewComponentView::updateProps( | |
| // update BaseComponentView props | ||
| updateAccessibilityProps(oldViewProps, newViewProps); | ||
| updateTransformProps(oldViewProps, newViewProps, Visual()); | ||
|
|
||
| // Handle overflow property changes | ||
| if (oldViewProps.yogaStyle.overflow() != newViewProps.yogaStyle.overflow()) { | ||
| auto compVisual = | ||
| winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual( | ||
| Visual()); | ||
| if (compVisual) { | ||
| if (newViewProps.yogaStyle.overflow() == facebook::yoga::Overflow::Hidden) { | ||
| compVisual.Clip(Compositor().CreateInsetClip(0.0f, 0.0f, 0.0f, 0.0f)); | ||
| } else { | ||
| compVisual.Clip(nullptr); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| base_type::updateProps(props, oldProps); | ||
|
|
||
| m_props = std::static_pointer_cast<facebook::react::ViewProps const>(props); | ||
|
|
@@ -1319,6 +1334,23 @@ void ViewComponentView::updateLayoutMetrics( | |
| Visual().Size( | ||
| {layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor, | ||
| layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor}); | ||
|
|
||
| // Apply overflow clipping | ||
| if (m_props && m_props->yogaStyle.overflow() == facebook::yoga::Overflow::Hidden) { | ||
| auto compVisual = | ||
| winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual( | ||
| Visual()); | ||
| if (compVisual) { | ||
| compVisual.Clip(Compositor().CreateInsetClip(0.0f, 0.0f, 0.0f, 0.0f)); | ||
| } | ||
| } else if (m_props) { | ||
| auto compVisual = | ||
| winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual( | ||
| Visual()); | ||
| if (compVisual) { | ||
| compVisual.Clip(nullptr); | ||
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| void ViewComponentView::prepareForRecycle() noexcept {} | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other overflow types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getClipsContentToBounds check this