xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Popup with "IsLightDismissEnabled" turned off closes when window focus is lost

Aculeo opened this issue · comments

I've noticed that a Popup closes when the window focus is lost. This is even when IsLightDismissEnabled is toggled off. In our use cases the popup should remain visible until the user actively dismisses it by confirming or cancelling. With the current behavior, the user cannot switch to a different window, copy something, and then return back to the application and paste the content into the popup.

Link to Reproduction Sample

Code to show popup:

var popup = new MyPopup();
Application.Current.MainPage.Navigation.ShowPopup(popup);

Popup Code:

<?xml version="1.0" encoding="UTF-8"?>
<views:Popup xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:views="http://xamarin.com/schemas/2020/toolkit"
             IsLightDismissEnabled="False"
             x:Class="PopupTest.MyPopup">
  <views:Popup.Content>
      <StackLayout>
          <Label Text="Hello Xamarin.Forms!" />
      </StackLayout>
  </views:Popup.Content>
</views:Popup>

I would like to provide a reproduction sample, but, alas, the company firewall makes this once again impossible 😑

Steps to Reproduce

  1. Open the popup
  2. Click somewhere outside the window to make it loose focus

Expected Behavior

Popup should remain visible.

Actual Behavior

Popup is closed.

Basic Information

  • Version with issue: 2.0.6
  • Last known good version: Probably none
  • IDE: Visual Studio 2022
  • Platform Target Frameworks:
    • UWP: Target Version 22H2 / 22621, Min Version 2004 / 19041
  • Affected Devices: Windows 10 device