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

Fix to focus on the date label after closing the dialog #1099

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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