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

default profile menu once opened in startup settings goes above the window when scrolling down #9320

Closed
ppn67 opened this issue Mar 1, 2021 · 4 comments · Fixed by #10922
Assignees
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-External For issues that are outside this codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Tracking-External This bug isn't resolved, but it's following an external workitem.

Comments

@ppn67
Copy link

ppn67 commented Mar 1, 2021

image

Environment

Windows build number: Version 10.0.19042.844
Windows Terminal version (if applicable): 1.7.572.0

Any other software?

Steps to reproduce

Settings-Startup-Default profile (tap arrow to open) and scroll down the window using mouse (the window not in maximize mode)

Expected behavior

selection menu (Windows PowerShell, Command Prompt, Azure Cloud Shell) - when expanded (while scrolling down) it does not move to the screen above the Windows PowerShell window (the window is not in maximize mode)

Actual behavior

The selection menu (Windows PowerShell, Command Prompt, Azure Cloud Shell) goes beyond the top edge of the Windows PowerShell window if the window is not in maximize mode

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 1, 2021
@zadjii-msft
Copy link
Member

Holy man that's bad. This is definitely a WinUI bug - I'll move it over there tomorrow morning. Thanks!

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Resolution-External For issues that are outside this codebase labels Mar 1, 2021
@zadjii-msft
Copy link
Member

Tracking microsoft/microsoft-ui-xaml#4554 upstream

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Tracking-External This bug isn't resolved, but it's following an external workitem. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 17, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Mar 17, 2021
@zadjii-msft zadjii-msft added the Product-Terminal The new Windows Terminal. label Mar 17, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 17, 2021
@zadjii-msft zadjii-msft added Area-Settings UI Anything specific to the SUI and removed Area-User Interface Issues pertaining to the user interface of the Console or Terminal labels Apr 29, 2021
@zadjii-msft zadjii-msft self-assigned this Aug 10, 2021
@ghost ghost added the In-PR This issue has a related PR label Aug 11, 2021
@ghost ghost closed this as completed in #10922 Aug 16, 2021
@ghost ghost removed the In-PR This issue has a related PR label Aug 16, 2021
ghost pushed a commit that referenced this issue Aug 16, 2021
…0922)

## Summary of the Pull Request

BODGY!

This solution was suggested in microsoft/microsoft-ui-xaml#4554 (comment).

When the window moves, or when a ScrollViewer scrolls, dismiss any popups that are visible. This happens automagically when an app is a real XAML app, but it doesn't work for XAML Islands.

## References
* upstream at microsoft/microsoft-ui-xaml#4554

## PR Checklist
* [x] Closes #9320
* [x] I work here
* [ ] Tests added/passed
* [ ] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

Unfortunately, we've got a bunch of scroll viewers in our SUI. So I did something bodgyx2 to make our life a little easier.

`DismissAllPopups` can be used to dismiss all popups for a particular UI element. However, we've got a bunch of pages with scroll viewers that may or may not have popups in them. Rather than define the same exact body for all their `ViewChanging` events, the `HasScrollViewer` struct will just do it for you!

Inside the `HasScrollViewer` stuct, we can't get at the `XamlRoot()` that our subclass implements. I mean, _we_ can, but when XAML does it's codegen, _XAML_ won't be able to figure it out.

Fortunately for us, we don't need to! The sender is a UIElement, so we can just get _their_ `XamlRoot()`.

So, you can fix this for any SUI page with just a simple 

```diff
-    <ScrollViewer>
+    <ScrollViewer ViewChanging="ViewChanging">
```

```diff
-    struct AddProfile : AddProfileT<AddProfile>
+    struct AddProfile : public HasScrollViewer<AddProfile>, AddProfileT<AddProfile>
```

## Validation Steps Performed

* the window doesn't close when you move it
* the popups _do_ close when you move the window
* the popups close when you scroll any SUI page
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Aug 16, 2021
DHowett pushed a commit that referenced this issue Aug 25, 2021
…0922)

BODGY!

This solution was suggested in microsoft/microsoft-ui-xaml#4554 (comment).

When the window moves, or when a ScrollViewer scrolls, dismiss any popups that are visible. This happens automagically when an app is a real XAML app, but it doesn't work for XAML Islands.

* upstream at microsoft/microsoft-ui-xaml#4554

* [x] Closes #9320
* [x] I work here
* [ ] Tests added/passed
* [ ] Requires documentation to be updated

Unfortunately, we've got a bunch of scroll viewers in our SUI. So I did something bodgyx2 to make our life a little easier.

`DismissAllPopups` can be used to dismiss all popups for a particular UI element. However, we've got a bunch of pages with scroll viewers that may or may not have popups in them. Rather than define the same exact body for all their `ViewChanging` events, the `HasScrollViewer` struct will just do it for you!

Inside the `HasScrollViewer` stuct, we can't get at the `XamlRoot()` that our subclass implements. I mean, _we_ can, but when XAML does it's codegen, _XAML_ won't be able to figure it out.

Fortunately for us, we don't need to! The sender is a UIElement, so we can just get _their_ `XamlRoot()`.

So, you can fix this for any SUI page with just a simple

```diff
-    <ScrollViewer>
+    <ScrollViewer ViewChanging="ViewChanging">
```

```diff
-    struct AddProfile : AddProfileT<AddProfile>
+    struct AddProfile : public HasScrollViewer<AddProfile>, AddProfileT<AddProfile>
```

* the window doesn't close when you move it
* the popups _do_ close when you move the window
* the popups close when you scroll any SUI page
@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10922, which has now been successfully released as Windows Terminal Preview v1.10.2383.0.:tada:

Handy links:

@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10922, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-External For issues that are outside this codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Tracking-External This bug isn't resolved, but it's following an external workitem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants