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

The ShouldConstrainToRootBounds property of the Popup doesn't work #5958

Closed
alexdi220 opened this issue Sep 24, 2021 · 41 comments
Closed

The ShouldConstrainToRootBounds property of the Popup doesn't work #5958

alexdi220 opened this issue Sep 24, 2021 · 41 comments
Labels
area-Popup product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Milestone

Comments

@alexdi220
Copy link
Contributor

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

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Sep 24, 2021
@codendone codendone added product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team and removed needs-triage Issue needs to be triaged by the area owners labels Sep 28, 2021
@codendone
Copy link
Contributor

ShouldConstrainToRootBounds="False" is not yet supported in WinUI 3.

@alexdi220
Copy link
Contributor Author

Thanks, @codendone . Could you add a note\remark in the documentation about that?

@krschau
Copy link
Contributor

krschau commented Oct 1, 2021

@gabbybilka Can we update the doc above to reflect that False is not yet supported? Thanks!

@gabbybilka
Copy link
Member

@krschau, yes!

mijacobs pushed a commit to MicrosoftDocs/winui-api that referenced this issue Oct 6, 2021
As per issue: microsoft/microsoft-ui-xaml#5958

WinUI 3 does not yet support Popup.ShouldConstrainToRootBounds = false.
@krschau
Copy link
Contributor

krschau commented Oct 12, 2021

Closing this, since the doc was updated. I'll try to leave a note here when this feature does light up.

@krschau krschau closed this as completed Oct 12, 2021
@Samuel12321
Copy link

@gabbybilka
Is there any update as to when this feature will be available in WinUI 3, as it is essential for some apps - Specifically FlyoutBase.ShouldConstrainToRootBounds

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Oct 27, 2021
@Samuel12321
Copy link

@krschau why was this closed when it hasn't been fixed yet?
ShouldConstrainToRootBounds="False" Still doesn't work in winui 3.

@krschau
Copy link
Contributor

krschau commented Oct 29, 2021

@Samuel12321 We should be enabling this soon, although it won't be quite soon enough for the WinAppSDK 1.0 release. As I mentioned when I closed it, I think that since it's now appropriately documented, this particular issue can be closed. This doesn't mean that we aren't working on enabling the feature.

I see pros and cons in closing or leaving issues open issues in situations like this, and we'll adjust if we see that the way we're doing it isn't helpful as we go forward.

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Oct 29, 2021
@asklar
Copy link
Member

asklar commented Nov 24, 2021

Tracked internally by https://task.ms/36484033

@Samuel12321
Copy link

Will a fix for this be included for 1.1?

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 28, 2022
@codendone
Copy link
Contributor

@Samuel12321 Additional feature work was necessary to properly support ShouldConstrainToRootBounds=False. That work is in progress, but it looks like it won't be complete in time for 1.1.

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Mar 1, 2022
@Samuel12321
Copy link

@codendone is there any update as to when this issue will be fixed. Its currently blocking my team from using WINUI 3.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 26, 2022
@codendone
Copy link
Contributor

@Samuel12321 Nothing new here from my previous comment: This unfortunately won't be enabled in 1.1. I'm hoping it will be in 1.2, but can't say for sure at this time.

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Apr 28, 2022
@Samuel12321
Copy link

@codendone is there any chance this will make it to one of the 1.1 servicing releases?
Sorry to bug, but this is a hugely problematic issue for my team and a few other projects I'm aware of.

@Samuel12321
Copy link

@krschau Will this be part of 1.2?

@Samuel12321
Copy link

@codendone @krschau will this be part of 1.2?

@codendone
Copy link
Contributor

@Samuel12321 Unfortunately this will not be in 1.2. Most of the implementation is complete, but there are a few critical issues which still need to be addressed.

@AlexanderBlackman
Copy link

I really hope this'll come sooner rather than later. It's probably the only feature I'd even use an experimental build for.

@AnalogFeelings
Copy link

AnalogFeelings commented Jan 23, 2023

Been almost 2 years since this issue was opened and it still hasn't been solved, even though apps like Files would benefit GREATLY from it. Is there any ETA or will there continue to be silence until someone else comes and complains about it?

EDIT: I'm also tired of Microsoft not saying anywhere that this is not a stable framework. Every time I tried to do something, I hit a roadblock or a bug. It's insane.

@Pdawg-bytes
Copy link

Pdawg-bytes commented Jan 23, 2023

I second what AZ said. This feature is very useful for many programs, and it also allows flyouts to work in more areas. Controls need to be able to spawn outside of the window bounds. Will there be an ETA? The last 3 predictions have been inaccurate. First, you said it would be in 1.0. Nope. Then, you said it'll probably be in 1.1. Nope. Now you're saying it won't be in 1.2. Will this come in 1.3? It's been just shy of two years and this feature still doesn't work.

@sylveon
Copy link
Contributor

sylveon commented Jan 25, 2023

I also agree. I am currently stuck on XAML Islands primarily because WinUI 3 doesn't implement this.

@yaira2
Copy link
Contributor

yaira2 commented 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.

@thexamlguy
Copy link

Will this ever be fixed?

@HannesHold
Copy link

No Assignees, No Projects and No Milestones yet. - Quite a good time period passed and it's getting frustrating and it feels like writing into a void. - Is there someone out there who actually can help out about this?

@codendone
Copy link
Contributor

This continues to be a work in progress. It still isn't ready to be part of the upcoming 1.3 release, but the goal is to complete it for 1.4.

@yaira2
Copy link
Contributor

yaira2 commented 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.

@andrezzzini
Copy link

this feature is really missed.

@zhuxb711
Copy link
Contributor

1.3 fixed nothing important, most bugs reported to WinUI team is being ignored.

It's too inefficient and I hope .Net team could hand over the repo one day as they are very efficient and never delay their due date. For WinUI team: Oh it's too hard and let's arrange it to next release (Repeat it); For .Net team: Oh it's too hard let's gathering around to solve it!

Sorry for the complaints and that's what I thought to WinUI team with very disappointment.

@sylveon
Copy link
Contributor

sylveon commented Apr 14, 2023

WinUI is a C++ library not a .NET one.

@AlexanderBlackman
Copy link

AlexanderBlackman commented Jun 14, 2023

This issue, however, doesn't have any known workarounds and it's one of the top frustrations for our user base.

@yaira2 Exactly.
The closest hypothetical workaround I've thought of is creating a new temporary window with just the menu options, but even that would be more trouble than it is worth. This has been an issue for years.

@Gaoyifei1011
Copy link

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

in windows app sdk 1.4-experimental 1 it is successfully work

@Samuel12321
Copy link

Samuel12321 commented Jul 8, 2023

Can we get some confirmation on whether this has been addressed in 1.4 experimental 1 from the wasdk dev team.
@codendone

@Pietro228
Copy link

Pietro228 commented Jul 8, 2023

In 1.4-experimental 1 it does work!

@ramjke
Copy link

ramjke commented Jul 19, 2023

In 1.4-experimental 1 it does work!

Confirmed. But there's a new problem. Now backdrop is also disabled when ShouldConstrainToRootBounds = False.

#8657

@khoabui1412
Copy link

MenuFlyoutItem doesn't have ShouldConstrainToRootBounds property, how to deal with that?

@sylveon
Copy link
Contributor

sylveon commented Aug 4, 2023

The property is on MenuFlyout itself

@khoabui1412
Copy link

@sylveon, I tested but it doesn't work for MenuFlyoutItem though set ShouldConstrainToRootBounds=false in MenuFlyout

@khoabui1412
Copy link

I clean the bin/obj, close vs and re-open, it's ok now.
sorry for make confused

@codendone codendone added this to the WinAppSDK 1.4 milestone Sep 20, 2023
@codendone
Copy link
Contributor

Closing as fixed in 1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Popup product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests