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

Flyout doesn't size to its content if no width/height is set in first child component #6591

Closed
lyahdav opened this issue Nov 20, 2020 · 3 comments
Labels
Area: Flyout Area: Layout bug Partner: Facebook Recommend: Not Planned Recommend that issue should be given Not Planned milestone.
Milestone

Comments

@lyahdav
Copy link
Collaborator

lyahdav commented Nov 20, 2020

Environment

  1. npx react-native --version: 4.13.0
  2. npx react-native run-windows --info:
  System:
    OS: Windows 10 10.0.19041
    CPU: (40) x64 Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
    Memory: 157.00 GB / 190.60 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.0-20190429.1820 - C:\open\fbsource\xplat\third-party\yarn\yarn.BAT
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
    Watchman: 20200724.030019 - C:\tools\watchman\watchman.EXE
  Installed UWP SDKs:
    10.0.18362.0
  1. reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock
    AllowDevelopmentWithoutDevLicense    REG_DWORD    0x1
    AllowAllTrustedApps    REG_DWORD    0x1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Run playground win32 app
  2. Go to Flyout example
  3. Change the code so that no width/height is set on the Flyout's child View

Expected Results

Expected: Flyout width/height is set automatically based on the size of its children.
Actual: Flyout size is set based on where the Flyout is present in the view hierarchy outside of the Flyout.

On Mac we fixed this by correctly resetting the shadow layout context:

@implementation PopoverShadowView

- (CGSize)contentSize {
  // There should only be one child.
  RCTShadowView* childShadowView = self.reactSubviews.firstObject;
  return childShadowView ? childShadowView.layoutMetrics.frame.size : CGSizeZero;
}

- (void)layoutSubviewsWithContext:(RCTLayoutContext)layoutContext {
  for (RCTShadowView* childShadowView in self.reactSubviews) {
    layoutContext.absolutePosition = CGPointZero;

    [childShadowView
        layoutWithMinimumSize:CGSizeZero
                  maximumSize:CGSizeMake(INFINITY, INFINITY)
              layoutDirection:RCTUIKitLayoutDirectionFromYogaLayoutDirection(self.direction)
                layoutContext:layoutContext];
  }
}

@end
@lyahdav lyahdav added the bug label Nov 20, 2020
@ghost ghost added Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) Partner: Facebook labels Nov 20, 2020
@lyahdav
Copy link
Collaborator Author

lyahdav commented Nov 20, 2020

Note I found a quick workaround: add a position: absolution style to the first child view in Flyout.

@asklar asklar added Area: Layout and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Nov 23, 2020
@asklar asklar added this to the Backlog milestone Nov 23, 2020
@asklar
Copy link
Member

asklar commented Nov 23, 2020

Could be an issue with the flyout viewmanager not setting the constraints properly. CC @kmelmon in case this looks familiar?
Putting in backlog as it isn't blocking right now.

@jonthysell jonthysell added the Recommend: Not Planned Recommend that issue should be given Not Planned milestone. label Aug 14, 2023
@chrisglein chrisglein closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
@chrisglein
Copy link
Member

Not something we plan to address on the Paper renderer as we move towards Fabric. The equivalent component for Fabric is tracked here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Flyout Area: Layout bug Partner: Facebook Recommend: Not Planned Recommend that issue should be given Not Planned milestone.
Projects
None yet
Development

No branches or pull requests

4 participants