.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,768 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
There is a known issue for DatePicker focus unfocus not working on .NET MAUI 8 Android. The below code helped me to solve the date picker issue:-
private DatePickerDialog mDialog;
protected override DatePickerDialog CreateDatePickerDialog(int year, int month, int day)
{
mDialog = base.CreateDatePickerDialog(year, month, day);
return mDialog;
}
protected override void ConnectHandler(MauiDatePicker platformView)
{
base.ConnectHandler(platformView);
mDialog.ShowEvent += OnDialogShown;
mDialog.DismissEvent += OnDialogDismissed;
}
private void OnDialogShown(object sender, EventArgs e)
{
VirtualView.IsFocused = true;
}
private void OnDialogDismissed(object sender, EventArgs e)
{
VirtualView.IsFocused = false;
}
Git hub link:- https://github.com/dotnet/maui/issues/18797
I need a similar solution for the time picker to solve my Focus and Unfocus issue. Also on iOS Date Picker the unfocus is triggered even before tapping the done button which leads to infinite loop
Please Help