Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Workaround for flyout centering problem",
"packageName": "react-native-windows",
"email": "kenander@microsoft.com",
"commit": "b0defe86c05d88310fb66663be45dd925d3b3207",
"date": "2019-11-11T20:58:16.583Z"
}
11 changes: 11 additions & 0 deletions vnext/ReactUWP/Views/FlyoutViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ void FlyoutShadowNode::AddView(ShadowNode &child, int64_t index) {

if (m_flyout != nullptr) {
m_flyout.Content(childView.as<winrt::UIElement>());
if (winrt::FlyoutPlacementMode::Full == m_flyout.Placement()) {
// When using FlyoutPlacementMode::Full on a Flyout with an embedded
// Picker, the flyout is not centered correctly. Below is a temporary
// workaround that resolves the problem for flyouts with fixed size
// content by adjusting the flyout presenter max size settings prior to
// layout. This will unblock those scenarios while the work on a more
// exhaustive fix proceeds. Tracked by Issue #2969
if (auto fe = m_flyout.Content().try_as<winrt::FrameworkElement>()) {
AdjustDefaultFlyoutStyle((float)fe.Width(), (float)fe.Height());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdjustDefaultFlyoutStyle((float)fe.Width(), (float)fe.Height()) [](start = 8, length = 63)

Please add a comment saying this is a temporary workaround and why it's needed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do.

}
}
}
}

Expand Down