PM-3349 Fix for TabGestureRecognizer not working inside the StackLayout area of IconLabelButton

This commit is contained in:
Dinis Vieira 2023-11-04 18:08:44 +00:00
parent c6309173ba
commit 840f24dbe5
No known key found for this signature in database
GPG key ID: 9389160FF6C295F3
3 changed files with 13 additions and 8 deletions

View file

@ -11,13 +11,13 @@
<RoundRectangle CornerRadius="{Binding CornerRadius, Source={x:Reference _iconLabelButton}}" />
</Border.StrokeShape>
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_OnTapped" Command="{Binding ButtonCommand, Source={x:Reference _iconLabelButton}}" />
</Grid.GestureRecognizers>
<StackLayout
Spacing="6"
Orientation="Horizontal"
HorizontalOptions="Center">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ButtonCommand, Source={x:Reference _iconLabelButton}}" />
</StackLayout.GestureRecognizers>
<controls:IconLabel
VerticalOptions="Center"
HorizontalTextAlignment="Center"

View file

@ -25,6 +25,8 @@ namespace Bit.App.Controls
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(
nameof(CornerRadius), typeof(CornerRadius), typeof(IconLabelButton));
public event EventHandler<TappedEventArgs> Tapped;
public IconLabelButton()
{
InitializeComponent();
@ -71,6 +73,11 @@ namespace Bit.App.Controls
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
}
private void TapGestureRecognizer_OnTapped(object sender, TappedEventArgs e)
{
Tapped?.Invoke(sender, e);
}
}
}

View file

@ -128,11 +128,9 @@
VerticalOptions="CenterAndExpand"
Icon="{Binding Source={x:Static core:BitwardenIcons.Suitcase}}"
Label="{u:I18n LogInSso}"
AutomationId="LogInWithSsoButton">
<controls:IconLabelButton.GestureRecognizers>
<TapGestureRecognizer Tapped="LogInSSO_Clicked" />
</controls:IconLabelButton.GestureRecognizers>
</controls:IconLabelButton>
AutomationId="LogInWithSsoButton"
Tapped="LogInSSO_Clicked"
/>
<Label
Text="{Binding LoggingInAsText}"
StyleClass="text-sm"