DatePicker Focused, UnFocused not working as expected
See original GitHub issueDescription
Preciously on XF DatePicker Focused
and UnFocused
events were triggered when opening and closing the date picker dialog
Now in Maui is not longer the case
Steps to Reproduce
- Open MauiApp2
- Set breakpoints on DatePicker Focus and Unfocused events
- Run the app
- Interact with DatePicker
Note: See the video attached for more info
Expected:
- Focused should trigger when the DatePicker dialog is opening
- UnFocused should trigger when the DatePicker dialog is closing
Current:
- Focused is not trigger when the DatePicker dialog is opening
- UnFocused is not trigger when the DatePicker dialog is closing
Link to public reproduction project repository
https://github.com/edgarfgp/DatePickerBugRepro
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
iOS, Android
Affected platform versions
iOS 15, Android 11
Did you find any workaround?
Write a Custom DatePicker Handler to set the VirtualView.IsFocused
Relevant log output
No response
Issue Analytics
- State:
- Created 8 months ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Focusing on DatePicker does not work MAUI
This is an issue on Github: Fix (or don't) the behavior of calling "Focus" on Android to open the picker . From the...
Read more >Untitled
... I don't know. easyexcel maven DatePicker Focused, UnFocused not working as expected … ... is not focused. - Expected behavior: DatePicker is...
Read more >JQuery UI Datepicker IE focus fix
At my current client we have multiple controls on the page that listen for onblur and onchange events to notify of changes to...
Read more >Datepicker focuses on date closest to today
Hi, I'd like to know why the Datepicker auto focuses on the date closest to today's date? ... How can the initial focused...
Read more >How to build an accessible datepicker component in React
In this article, we will be focusing on making the component ... When the datepicker is visible, the calendar will not be visible...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Workaround:
On iOS, we can directly listen to
EditingDidBegin
andEditingDidEnd
. On Android, it’s a little bit more complicated.FocusChange
doesn’t trigger becauseMaui.DatePickerHandler
setsFocusableOnTouchMode
to false. So instead we can intercept the DatePickerDialog and listen forShowEvent
andDismissEvent
.DatePickerWithFocusHandler.cs
DatePickerWithFocusHandler.Android.cs
DatePickerWithFocusHandler.iOS.cs
MauiProgram.cs
@PureWeen @jsuarezruiz As this issue has been resolved now, when it’s going to be released 😬?