xamarin/Xamarin.Forms

[Shell] Unable to focus and unfocus search handler for Android

オープン

#7,956 opened on 2019/10/11

 (9 件のコメント) (7 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
a/shell :shell:e/5 :clock5:help wantedinactivep/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

The event focus is not called when search bar got focus and the same issue happens with unfocus for Android. A similar bug has been reported in the follow link https://github.com/xamarin/Xamarin.Forms/issues/5768. Despite of the fact that issue n° 5768 is closed at this moment it still happens in Android. I've tested in the Xaminals example project and even updating the dll of the xamarin.forms to the last version the problem remains.

Steps to Reproduce

  1. Start with search hidden
  2. Tap a search icon (toolbaritem or whatever) to open the search (expanded)
  3. Override in the SearchHandler class the OnFocused event or try to give a name in the control of the Shell.SearchHandler tag in XAML, in the code behind (xaml.cs) create the method protected void Element_Focused(object sender, EventArgs e). Neither the event nor the OnFocused is called when the search bar got focus.

Expected Behavior

The Event in code behind or OnFocused be called.

Actual Behavior

Cannot

Basic Information

It can be tested in the Xaminals project example, link to download https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/userinterface-xaminals/

  • Version with issue:
  • Last known good version:
  • IDE: Visual Studio Professional 2019.
  • Platform Target Frameworks: Xamarin Forms.
    • Android:
  • Nuget Packages: Xamarin.Forms.dll 4.3.0.851321-pre3 (last version at this moment).
  • Affected Devices: Samsumg galaxy S10 (emulator android 9.0); Samsumg galaxy S6 (emulator android 5.1) and Motorola Moto e (physical android 8.0)

ShellSerchFocusIssue.zip

Screenshots

The screenshots is attached.

Reproduction Link

https://github.com/JeysonGustavo/ShellSearchBarFocusIssue

コントリビューターガイド