xamarin/Xamarin.Forms
[Shell] Unable to set text outside constructor and OnAppearing in search bar
Aperta
#8237 aperta il 25 ott 2019
a/shell :shell:e/3 :clock3:help wantedinactivet/bug :bug:up-for-grabs
Metriche repository
- Star
- (5644 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Description
Is not possible to set a text in search bar of shell menu outside the constructor and OnAppearing methods.
OBSERVATION: In this example, I tested the monkeys page. ShellSearchBarTextIssue.zip
Steps to Reproduce
- In <Shell.SearchHandler> tag of the page set a name for the Search Handler control (x:name), for example x:name="searchTest".
- In the .cs file override the OnAppearing method set the query property of the search handler, for example searchTest.Query="Test". It works well as expected.
- Repeat the step 2 for the constructor of the .cs file.
- Create a button anywhere on the page and create a click event.
- Set the query property of the search handler in the click event, for example searchTest.Query="Test";.
Expected Behavior
The search bar displays the text setting in the click event.
Actual Behavior
The search bar does not show the text setted.
Basic Information
- Version with issue: Xamarin.forms.dll 4.3.0.908675
- Last known good version: 4.3.0.908675
- IDE: Visual Studio Professional 2019.
- Platform Target Frameworks:
- Android: API 22 above.
- Android Support Library Version: 5.1 above.
- Nuget Packages: Xamarin.Forms.dll 4.3.0.908675
- Affected Devices: Samsung Galaxy S6, S7, S8 Plus, S10 plus, Motorola Moto E Play.
Screenshots
Reproduction Link
https://github.com/JeysonGustavo/ShellSetSearchText
Take a look at the MonkeysPage