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

[Android] Editing a TextBox located in a Popup may crash the app #2533

Closed
12 tasks
jeromelaban opened this issue Jan 24, 2020 · 5 comments
Closed
12 tasks

[Android] Editing a TextBox located in a Popup may crash the app #2533

jeromelaban opened this issue Jan 24, 2020 · 5 comments
Labels
area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)

Comments

@jeromelaban
Copy link
Member

jeromelaban commented Jan 24, 2020

Current behavior

Opening a ContentDialog which contains a TextBox may crash the app with the following exception:

EditView android.view.WindowManager$BadTokenException: Unable to add window

Expected behavior

The application does not crash and editing the TextBox works.

Workaround

Set FeatureConfiguration.Popup.UseNativePopup to false.

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

The issue arises when the OS is trying to add the Copy/Past dialog, and does not seem to find where to place it.

@jeromelaban jeromelaban added kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform labels Jan 24, 2020
@francoistanguay francoistanguay modified the milestone: 3.1 Aug 29, 2020
@agneszitte agneszitte added the project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …) label Sep 21, 2020
@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts area/eu and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jun 1, 2021
@trungnt2910
Copy link
Contributor

trungnt2910 commented Sep 19, 2021

With quite a few ComboBox-related duplicate issues closed, and the main issue quite hard to find using GitHub's search, I'd say this deserves some documentation.

Furthermore, why are native Popups the default, when they are currently faulty? This forces developers to write platform-specific code every time.

A search on Google only points to this:

[Android] Add support for non-native Popup by default. Can be enabled through FeatureConfiguration.Popup.UseNativePopup set to false (See #2533 for more details)
in some ancient release notes.

@jeromelaban
Copy link
Member Author

Furthermore, why are native Popups the default, when they are currently faulty? This forces developers to write platform-specific code every time.

Native popups are not disabled by default because of side effects that we have not had the time to investigate. They are not faulty for most cases.

@Youssef1313
Copy link
Member

issue2533

I wasn't able to reproduce. @jeromelaban Is there anything needed more than the sample in SamplesApp to reproduce this?

@jeromelaban
Copy link
Member Author

@Youssef1313 it may crash the app if the textbox's IME popup appears (e.g. to copy/paste text)

@MartinZikmund MartinZikmund changed the title [Android] Editing a TextBox located in a Popup may crash the app [Android] Editing a TextBox located in a Popup may crash the app Jun 12, 2023
@MartinZikmund
Copy link
Member

This should not be an issue anymore as we are now using the managed popups by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)
Projects
None yet
Development

No branches or pull requests

6 participants