Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Android] Calling Focus on all Pickers running an API 28 devices no longer opens Picker #5159

Closed
@varyamereon

Description

@varyamereon

Description

When using API Level 28, calling Focus on a DatePicker with Visible set to false does not show the date picker dialog.

Prior to this PR https://github.com/xamarin/Xamarin.Forms/pull/4344/files#diff-446294d29d78ca8d84e4c0ddc20bbc07L132 the Picker was opened as part of the FocusRequestedEvent. PR #4344 brought DatePicker inline with the other pickers by changing it to trigger a Click on the control which then would trigger the click listener to open the picker.

On API 28 FocusRequestedEvent is still called so there is still an opportunity to react to this. The difference on API 28 is that the Focus request fails so the Click Listener never actually fires.

Possible fix ideas

Steps to Reproduce

  1. Add a date picker and a button on a Forms page. Set the visibility of the date picker to false
  2. Use the button to call Focus on the date picker.
  3. On API 27 and lower the dialog is shown. Not on API 28.

Expected Behavior

DatePicker dialog is shown.

Actual Behavior

Nothing happens.

Basic Information

  • Version with issue: 4.0.0.135214-pre4
  • Last known good version: Unknown
  • IDE: Visual Studio 2019 Windows
  • Platform Target Frameworks:
    • Android: API 28
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices: Android

Screenshots

n/a

Reproduction Link

Reproduction

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions