microsoft / microsoft/react-native-windows

Enable wrapping of NavigationView/TabView like controls

Open
#3,581 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Layout enhancement Needs: Dev Design Partner: Microsoft Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

This issue was discovered by Office folks when they attempted to wrap the XAML TwoPaneView. The issue occurs when you have this sort of arrangement:

[WrappedControl]
  [Component /]
  [etc]
[/WrappedControl]

In this situation, the WrappedControl runs layout in XAML which flexbox has no knowledge of. Inside the WrappedControl are react-native components which need flexbox to layout correctly. This doesn't currently work because flexbox is "stomping over" the properties that XAML is supposed to be in control of.

We know of several WinUI controls that behave similarly to TwoPaneView (NavigationView and TabView). So this will be a general problem moving forward if we want to wrap those types of controls.

There does appear to be a way to resolve the conflict - we'd need to let XAML participate in the overall layout process and override flexbox when necessary. Note that this solution would need to take the upcoming Fabric change into consideration - in that world, layout is running off of the UI thread, so letting XAML override becomes more difficult.

This issue is tracking solving this general problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how wrapped XAML controls and React Native flexbox participate in layout, using the TwoPaneView arrangement described in the issue. Compare the requirements for NavigationView and TabView, then account for Fabric layout running off the UI thread. Done means these controls can wrap React Native children without XAML-controlled properties being overwritten.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
desktop, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.