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

Datepicker Two-Way Binding On Android #9180

Open
EmberLynn opened this issue Aug 3, 2022 · 3 comments · May be fixed by #16153
Open

Datepicker Two-Way Binding On Android #9180

EmberLynn opened this issue Aug 3, 2022 · 3 comments · May be fixed by #16153
Labels
area-controls-datetimepicker DatePicker, TimePicker platform/android 🤖 t/bug Something isn't working
Milestone

Comments

@EmberLynn
Copy link

Description

I'm having an issue with DatePicker's behavior and am going to assume it is a bug.

Here is what our DatePicker looks like in XAML:

datepicker

DateValue is a property that belongs to the CustomFormField model. A DateValue of null is an acceptable value within the CustomFormField. When the picker renders on screen, it displays today's date by default (when TextValue starts at null):

default date

If you click on the DatePicker and attempt to select today's date, the DateSelected event is not fired therefore failing to bind to the new date. The only way to fire the DateSelected event is to select a different date on the DatePicker and then go back and select today's date.

(Since I am not testing on iOS, I cannot confirm if this is a bug on iOS)

Steps to Reproduce

  1. Create a DatePicker and bind the Date property to a null date property within a model.
  2. Create a function in the code behind file to be called when DateSelected event is fired.
  3. Use a breakpoint (or pop-up) in the code behind function.
  4. Select today's date with the DatePicker.
  5. Watch as the function in the code behind isn't called.

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

My terrible and unacceptable workaround is setting model properties in the code behind.

Relevant log output

No response

@EmberLynn EmberLynn added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Aug 3, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Aug 4, 2022
@jfversluis jfversluis added platform/android 🤖 area-controls-picker Picker and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Aug 4, 2022
@jfversluis jfversluis added this to the Backlog milestone Aug 4, 2022
@jfversluis jfversluis added area-controls-datetimepicker DatePicker, TimePicker and removed area-controls-picker Picker labels Aug 4, 2022
@GuildOfCalamity
Copy link

GuildOfCalamity commented Aug 20, 2022

I'm having the same issue (using Windows platform)... it seems like the Date binding is not being observed by the control. I have tried OneWay and TwoWay to no avail. The only workaround I could find was to attach a EventToCommandBehavior to the DateSelected event.

@ideas2appsaustralia
Copy link

Same problem using visual studio 2022 17.4.0 Preview 1.0 with MAUI. Setting the Datepickers Date to ViewModel observableProperty via Binding and changing the binding source value does not update to the Datepicker. Datepicker only shows todays date and Binding do not change it.

@samhouts samhouts modified the milestones: Backlog, Under Consideration Jul 26, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@peruchali
Copy link

@samhouts Could you reconsider this item? Having the Date binding not work on Android is the mainline, most basic scenario for this control, which leaves it broken out of the box. It seems like it shouldn't be in the backlog.

@PureWeen PureWeen modified the milestones: Under Consideration, Backlog Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-datetimepicker DatePicker, TimePicker platform/android 🤖 t/bug Something isn't working
Projects
None yet
8 participants