Xamarin.forms: [Bug] [Android] Error back hardware button with Picker

Created on 29 Aug 2019  路  1Comment  路  Source: xamarin/Xamarin.Forms

Description

On Android, if you use a Picker and press the BACK hardware button, it closes the picker and comes back to the page. If you press the BACK hardware button again, it opens the Picker again. And it does it on a loop.
If you unfocus the Picker, it doesn't do it anymore.

Steps to Reproduce

  1. Create a picker
  2. Launch Android app
  3. Click on picker
  4. Click on hardware back button
  5. Click on hardware back button (the picker open)

Expected Behavior

The second BACK button pressed should not open the Picker.

Actual Behavior

The second BACK button pressed open the Picker.

Basic Information

  • Version with issue: 4.2.0.709249
  • Last known good version: 4.1.0.709244
  • IDE: Visual Studio 2019 16.2.3
  • Platform Target Frameworks:

    • Android: 9.0

  • Nuget Packages: Xamarin.Forms
  • Affected Devices: Android (tested : 7, 8 and 9)

Reproduction Link

PickerAndroidBug.zip

regression Android bug

Most helpful comment

@pierre-galaup thanks for reporting this!

It seems with the change in #5960 we are actually monitoring the right keys to open the Picker again. Unfortunately, the back button is one of the buttons we act on, wrongfully. I already had a PR in the works for another Picker bug, and I added this fix to that. I hope it should be merged soon!

>All comments

@pierre-galaup thanks for reporting this!

It seems with the change in #5960 we are actually monitoring the right keys to open the Picker again. Unfortunately, the back button is one of the buttons we act on, wrongfully. I already had a PR in the works for another Picker bug, and I added this fix to that. I hope it should be merged soon!

Was this page helpful?
0 / 5 - 0 ratings