[iOS] Picker fails to open on first tap when Styles are changed on focus
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 296
Description
Description
When placing a Picker inside a ListView header and modifying its style within the OnFocus method, the picker requires multiple user interactions (clicks/taps) to open.
Expected Behavior:
The picker should open on the first click/tap.
Actual Behavior:
The picker only opens after multiple clicks/taps.
Additional Information:
This issue is reproducible only when the Picker is inside a ListView header. The problem does not occur when using a CollectionView header.
<ListView>
<ListView.Header>
<Picker Focused="VisualElement_OnFocused"
Style="{StaticResource PickerUnSelectedStyle}"
Unfocused="Picker_OnUnfocused"
x:Name="Picker"
Title="Select a monkey">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</ListView.Header>
</ListView>
private void VisualElement_OnFocused(object sender, FocusEventArgs e)
{
Picker.Style = Application.Current?.Resources["PickerSelectedStyle"] as Style;
}
private void Picker_OnUnfocused(object sender, FocusEventArgs e)
{
Picker.Style = Application.Current?.Resources["PickerUnSelectedStyle"] as Style;
}
Steps to Reproduce
- Run the attached sample
SampleButtonCommandIssue.zip - Click on the picker
Link to public reproduction project repository
No response
Version with bug
9.0.110 SR12
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
Use a CollectionView instead of ListView
Relevant log output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the attached SampleButtonCommandIssue.zip on iOS and reproduce the Picker inside a ListView header while changing its Style in OnFocus. Compare the behavior with a CollectionView header and trace the focus and style-change interaction. Done means the Picker opens on the first tap without removing the described styling behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, ios
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100