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

[Scenario Day] Picker SelectedIndex property not working #7138

Open
jsuarezruiz opened this issue May 13, 2022 · 8 comments
Open

[Scenario Day] Picker SelectedIndex property not working #7138

jsuarezruiz opened this issue May 13, 2022 · 8 comments
Labels
area-controls-picker Picker platform/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage scenario-day t/bug Something isn't working
Milestone

Comments

@jsuarezruiz
Copy link
Contributor

Description

Picker SelectedIndex property not working.

<Picker Title="Select a monkey"
            SelectedIndex="3">
        <Picker.Items>
            <x:String>Baboon</x:String>
            <x:String>Capuchin Monkey</x:String>
            <x:String>Blue Monkey</x:String>
            <x:String>Squirrel Monkey</x:String>
            <x:String>Golden Lion Tamarin</x:String>
            <x:String>Howler Monkey</x:String>
            <x:String>Japanese Macaque</x:String>
        </Picker.Items>
    </Picker>

image

Steps to Reproduce

  1. Create a new .NET MAUI from template.
  2. Paste the previous piece of code.
  3. Launch the App.

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Windows SDK 10.0.17134.0, Android 11

Did you find any workaround?

No response

Relevant log output

No response

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/windows 🪟 platform/android 🤖 area-controls-picker Picker s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 13, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 13, 2022
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 13, 2022
@XamlTest
Copy link
Collaborator

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32427.455.main]. Not repro on Windows and Android 12. Sample Project: 7138.zip

Windows:
image
Android:
image

@hafzaal
Copy link

hafzaal commented Jun 27, 2022

@XamlTest This doesn't seem to be working on VS community 17.3.0 preview 2. I downloaded the project you linked and I'm getting this:

Pixel 5 Android 12.0:
pixel

Windows:
windows

@rachelkang rachelkang added this to the 6.0-servicing milestone Jun 30, 2022
@WdeBruin
Copy link
Contributor

I think this is the same issue as #9150

@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@KarthikRajaKalaimani
Copy link

Still the issue presist in .Net 7.0 sample and Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.6.0 Preview 1.0.

image

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 5, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 4, 2023
@XamlTest
Copy link
Collaborator

XamlTest commented May 4, 2023

Verified this on Visual Studio Enterprise 17.6.0 Preview 6.0. Repro on Windows 11 and Android emulator (13.0-API 33) with Project: 7138.zip

Android:
image

Windows:
image

@StephaneDelcroix
Copy link
Contributor

I think it's a matter of declaration order. Xaml respects the order in which you set the properties, and in the snippet the selected index is set before the items, at a time there are no items, and is probably coerced back to 0 or -1.

@MacrayBlackhand
Copy link

I'm having this issue as well. I suspect it is due to the fact that I make async calls to populate the ObservableCollections bound to the Pickers and the response just isn't back when the Picker is rendered and the SelectedIndex is trying to be set.

We need an event exposed when the ItemSource is bound or populated or something like that.

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 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/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage scenario-day t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests