Skip to content

DatePicker doesnt fire for DateSelected event on same date #13156

@duindain

Description

@duindain

Description

The DatePicker has a default date of todays date, if someone selects that same date the dialog closes but the DateSelected doesn't fire

If you didn't pass in an initial date this effectively prevents a user from selecting today's date, if you do have a date bound it prevents selecting that date which means any extra code in the DateSelected event doesn't fire

This is related to #9180 though that was Android specific and for .Net 6

Steps to Reproduce

  1. Create File > New .Net Maui App
  2. Add a DatePicker to MainPage.xaml
  3. Add a DateSelected event handler
  4. Add a debug statement to the handler to see when the event is fired
  5. Run the app and select todays date, no event is fired

Link to public reproduction project repository

https://github.com/duindain/DateChanger

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, I was not able test on other platforms

Affected platform versions

Android 11 and up, WindowsSDK 10.0.19041, iOS 16.1

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions