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

Popup allows background interactions in .NET MAUI but not in Xamarin #27740

Open
KR-Tech-Cell opened this issue Feb 12, 2025 · 6 comments
Open
Labels
area-controls-modal s/needs-info Issue needs more info from the author t/bug Something isn't working

Comments

@KR-Tech-Cell
Copy link

Description

When using a ContentView as a popup in .NET 8 MAUI , background elements (such as textboxes or buttons) still receive touch events. This issue did not occur in Xamarin, where popups automatically blocked interactions with background elements.

.NET MAUI Version: 8.0.3
Visual Studio Version: 2022
Platform: Android

Expected Behavior:
When the popup is open, all background elements should be disabled, preventing unintended interactions.
This behavior worked automatically in Xamarin but does not in MAUI.
Actual Behavior:
Background elements (like textboxes) receive touch events even when the popup is open.

Steps to Reproduce

  • Create a ContentView as a popup inside a page.
  • Add a ListView or a Button inside the popup.
  • Place a Entry field in the background (behind the popup).
  • Open the popup and tap inside it (e.g., on the title).
  • Notice that the background Entry receives focus, and the keyboard opens.

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

Manually setting layout.IsEnabled = false; when the popup opens, and enabling it again when the popup closes.
popup.Opened += (s, e) => { layout.IsEnabled = false; };
popup.Closed += (s, e) => { layout.IsEnabled = true; };

And also tried setting InputTransparent="False" on parent element of popup.

However, this was not required in Xamarin.

Relevant log output

@KR-Tech-Cell KR-Tech-Cell added the t/bug Something isn't working label Feb 12, 2025
@nk-alex
Copy link

nk-alex commented Feb 12, 2025

#22442 #10252 #12014

@jfversluis jfversluis added the s/needs-repro Attach a solution or code which reproduces the issue label Feb 12, 2025
@jfversluis
Copy link
Member

What is "a popup"? Is this a third-party control? If yes, which one?

Also, can you confirm this is still an issue when using .NET 9? Please note that unlike .NET, .NET MAUI does not have LTS. See: https://dotnet.microsoft.com/platform/support/policy/maui, so there should be no reason for you to not update to .NET 9 for your .NET MAUI apps.

@LeeWhite187
Copy link

@jfversluis His bug report describes the popup as a "ContentView as a popup".
I've hit a similar click passthrough problem, when testing app functions in MAUI.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Feb 12, 2025
@jfversluis
Copy link
Member

jfversluis commented Feb 12, 2025

That still leaves the question; how does the navigation work? How do you open the popup? A popup is not a concept named as such in .NET MAUI itself. I can interpret this multiple ways. Thats why a reproduction is always super helpful :)

@LeeWhite187 in what version are you seeing this? Did you test .NET 9?

@jfversluis jfversluis added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Feb 12, 2025
Copy link
Contributor

Hi @KR-Tech-Cell. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jfversluis
Copy link
Member

Is this a duplicate here? #26026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-modal s/needs-info Issue needs more info from the author t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants