question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The ShouldConstrainToRootBounds property of the Popup doesn't work

See original GitHub issue

Describe the bug How can I show a popup out of the window’s bounds? The ShouldConstrainToRootBounds looks pretty good (doc) but doesn’t work and the IsConstrainedToRootBounds property always returns true

Steps to reproduce the bug

    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button Content="Click" Click="Button_Click"/>
        <Popup x:Name="popup" ShouldConstrainToRootBounds="False">
            <Border Width="100" Height="500" Background="Red" BorderThickness="3" BorderBrush="Black"/>
        </Popup>
    </StackPanel>
    public sealed partial class MainWindow : Window {
        public MainWindow() {
            this.InitializeComponent();
        }
        void Button_Click(object sender, RoutedEventArgs e) {
            popup.IsOpen = !popup.IsOpen;
        }
    }

Expected behavior

Screenshots image

image

Version Info

NuGet package version:

Windows app type:

UWP Win32
Yes
Windows version Saw the problem?
Insider Build (xxxxx)
May 2021 Update (19043)
October 2020 Update (19042)
May 2020 Update (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:14
  • Comments:40 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
yaira2commented, Apr 4, 2023

@codendone thank you for the transparency on the timeline. We’ve been waiting for a long time for this to be fixed and 1.4 is too far away, it’s not the only issue we’ve had but most of the time we’re able to work around them. This issue, however, doesn’t have any known workarounds and it’s one of the top frustrations for our user base.

I hope you can take this feedback into consideration and increase the priority of getting this into a servicing release so that we don’t have to wait for 1.4.

6reactions
yaira2commented, Feb 14, 2023

@gabbybilka are there any updates on this? Overall, our experience has been positive, but this is one of the main issues we’re having since migrating to WinAppSdk.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - ContentDialog wasn't shown Over the Popup When ...
When a popup with ShouldConstrainToRootBounds = false is first shown, it's placed in its own window and shown in that context. That's why...
Read more >
Popup.ShouldConstrainToRootBounds Property
Gets or sets a value that indicates whether the popup should be shown within the bounds of the XAML root. This property is...
Read more >
Popup.ShouldConstrainToRootBounds Property
This property is applicable only to apps running on the desktop. On other platforms (such as Xbox, HoloLens, etc.), it does not have...
Read more >
Fix ComboBox displaying incorrectly in ViewBox in UWP ...
ShouldConstrainToRootBounds is a property that determines if a popup should show within its XAML root, or in a separate top level window.
Read more >
Microsoft release Windows UI Library 3 Preview 4
More specifically, the ShouldConstrainToRootBounds property always acts as if it's set to true , regardless of the property value. Inking ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found