Skip to content

[iOS] Picker fails to open on first tap when Styles are changed on focus #32127

@Char0394

Description

@Char0394

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.

Image

<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

  1. Run the attached sample
    SampleButtonCommandIssue.zip
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions