Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Picker does Not Resize Automatically After Selection #19295

Open
Quaybe opened this issue Dec 7, 2023 · 3 comments · May be fixed by #20207
Open

iOS - Picker does Not Resize Automatically After Selection #19295

Quaybe opened this issue Dec 7, 2023 · 3 comments · May be fixed by #20207
Labels
area-controls-picker Picker platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Quaybe
Copy link

Quaybe commented Dec 7, 2023

Description

With the Picker in iOS, the picker does not resize automatically after selection. If you select an item that is longer than the original value of the Picker box, it is cut off:

iOS:
image

Expectation:
The Picker box should resize accordingly to display the longer string. This is the behavior in Windows and Android, this issue only applies to iOS. Have not tested Mac.

Android:
image

Windows:
image

Steps to Reproduce

  1. Create new .NET MAUI app
  2. Add Picker anywhere on screen in XAML
  3. Set Title to a short string such as "test"
  4. Add items to Picker with longer strings such as "long string test". Picker XAML example:
<Picker x:Name="picker" Grid.Column="1" VerticalOptions="Center" HorizontalOptions="Center" HorizontalTextAlignment="Center" Title="Short">
	<Picker.ItemsSource>
		<x:Array Type="{x:Type x:String}">
			<x:String>Short</x:String>
			<x:String>TEST</x:String>
			<x:String>ACL</x:String>
			<x:String>Long String</x:String>
			<x:String>Even Longer String</x:String>
			<x:String>Howler Monkey</x:String>
			<x:String>Japanese Macaque</x:String>
		</x:Array>
	</Picker.ItemsSource>
</Picker>
  1. Run app on iOS.
  2. Select one of the longer items in the Picker, tap "done"
  3. Notice that the Picker box was not resized to display the new, longer string.

Expectation:
The Picker box should resize accordingly to display the longer string. This is the behavior in Windows and Android, this issue only applies to iOS. Have not tested Mac.

Link to public reproduction project repository

https://github.com/Quaybe/iOS-Picker-Bug

Version with bug

8.0.3

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

iOS 17

Did you find any workaround?

Disable and enable the Picker every time the selection is changed, and it is forced to redraw to the correct size. This is my workaround currently for iOS.

Relevant log output

No response

@Quaybe Quaybe added the t/bug Something isn't working label Dec 7, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Dec 7, 2023
@PureWeen PureWeen added this to the Backlog milestone Dec 7, 2023
@ghost
Copy link

ghost commented Dec 7, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@XamlTest
Copy link

XamlTest commented Jan 10, 2024

Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3). Repro on iOS 17.0, not repro on Windows 11 and Android 14.0-API34 with below Project:
iOSPickerBug.zip

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jan 10, 2024
@kubaflo kubaflo linked a pull request Jan 28, 2024 that will close this issue
@kubaflo
Copy link
Contributor

kubaflo commented Jan 28, 2024

@PureWeen @Quaybe a possible fix here :) #20207

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-picker Picker platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants