Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Fix to focus on the date label after closing the dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-dev003 committed Aug 1, 2022
1 parent c613149 commit e43ba37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Prism.Navigation;
using Xamarin.Forms;
using Xamarin.Essentials;
using Xamarin.CommunityToolkit.Extensions;

namespace Covid19Radar.ViewModels
{
Expand Down Expand Up @@ -329,7 +330,7 @@ INavigationParameters navigaitonParameters
loggerService.EndMethod();
});

public Command OnClickQuestionIcon => new Command(() =>
public Command OnClickQuestionIcon => new Command<Label>((dateLabel) =>
{
loggerService.StartMethod();
Expand All @@ -338,6 +339,14 @@ INavigationParameters navigaitonParameters
null,
AppResources.ButtonClose);
if (Device.RuntimePlatform == Device.iOS && dateLabel != null)
{
Device.BeginInvokeOnMainThread(() =>
{
SemanticExtensions.SetSemanticFocus(dateLabel);
});
}
loggerService.EndMethod();
});

Expand Down
6 changes: 4 additions & 2 deletions Covid19Radar/Covid19Radar/Views/HomePage/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
Source="question_icon.png"
Padding="5"
BackgroundColor="Transparent"
Command="{Binding Path=OnClickQuestionIcon}">
Command="{Binding Path=OnClickQuestionIcon}"
CommandParameter="{x:Reference activeConfirmationDateLabel}">
<ImageButton.IsVisible>
<OnPlatform
x:TypeArguments="x:Boolean"
Expand All @@ -90,7 +91,8 @@
AutomationProperties.Name="{x:Static resources:AppResources.HomePageQuestionIconAccessibilityTextiOS}"
Aspect="AspectFit"
Source="question_icon.png"
Command="{Binding Path=OnClickQuestionIcon}">
Command="{Binding Path=OnClickQuestionIcon}"
CommandParameter="{x:Reference activeConfirmationDateLabel}">
<ImageButton.IsVisible>
<OnPlatform
x:TypeArguments="x:Boolean"
Expand Down

0 comments on commit e43ba37

Please sign in to comment.