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

Picker SelectedItem set to null on Popup #14832

Open
acaliaro opened this issue Apr 28, 2023 · 8 comments
Open

Picker SelectedItem set to null on Popup #14832

acaliaro opened this issue Apr 28, 2023 · 8 comments
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

@acaliaro
Copy link

Description

I'm trying to initialize the SelectedItem of a picker. If they are in a Page, initialization is successful. If I try to do the same initialization in a Popup, the SelectedItem is first set correctly, but then it is set to null.

Steps to Reproduce

1 Open the solution
2 Run it on an iPad
3 the Picker on the page is set to Outlet1
4 Press the button
5 The picker on the popup is not set

Link to public reproduction project repository

https://github.com/acaliaro/MauiPicker

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iPad 15.7

Did you find any workaround?

No, any workaround found

Relevant log output

[0:] OnSelectedItemOutletChanged: Outlet1
[0:] OnSelectedItemOutletChanged: value = null
This is the OnSelectedItemOutletChanged in the popup
@acaliaro acaliaro added the t/bug Something isn't working label Apr 28, 2023
@acaliaro
Copy link
Author

I think it is similar to

#13013

but I don't know why it has been closed

@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 28, 2023
@PureWeen PureWeen added this to the Backlog milestone May 3, 2023
@ghost
Copy link

ghost commented May 3, 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.

@jamesmontemagno
Copy link
Member

Is this an issue with the Picker control or in the community toolkit as you mentioned it works fine with on a ContentPage correct?

@acaliaro
Copy link
Author

acaliaro commented May 4, 2023

The problem is the picker in the popup. In the contentpage it works

@codeaphex
Copy link

codeaphex commented May 13, 2023

@jamesmontemagno I have the same problem with a custom "region" navigation. So I have subviews loaded into a "region" control, which is really just a ContentView. If the picker is inside the region it gets nulled. If its inside the mainpage or view it is initialized correctly.
It just works if I decouple the bounded property from the model and set it in the NavigatedTo method.

        public async override void NavigatedTo(object parameter = null)
        {
            if(SelectedItem != null)
            {
                SelectedProvider = Provider.First(x => x == SelectedItem.Provider);
                SelectedGroup = SelectedItem?.GroupID == null ? null : Groups.First(x => x.ID == SelectedItem.GroupID);
            }

            base.NavigatedTo(parameter);
        }

@acaliaro I dont know if its possible for you to use a similar workaround.

@acaliaro
Copy link
Author

I think no...

@acaliaro
Copy link
Author

Hi, there are some news about this?

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

XamlTest commented Jul 5, 2023

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on iOS 16.4 and iPad 16.4 with below Project:
MauiPicker.zip

@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/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

No branches or pull requests

7 participants