Time Picker Focus and UnFocus is not working
Chinmay Dole
200
Reputation points
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
Sign in to answer