Hi,
There's been a very problematic bug in the SfButton MAUI control on iOS which has been causing a lot of problems for us. I'm not 100% sure if it's new to Vol 4 (24.1.24) - suspect it has been ongoing issue for a while.
The regular MAUI Button control handles the click event (via Command property) and does not pass the gesture/tap to it's parent element - which is the exact behaviour we need.
However the SyncFusion Button control handles the click event (via Command property) but then it also passes the gesture/tap to parent element - which is not the behaviour we want.
This is very problematic for our App as we have various places (such as panels, List items etc) where we want a unique action if a hosted button is clicked and we don't want it passed through to the host element. For example - a List of items where we want one action if the item is clicked and a different unique action if button on each item is clicked (ie. an additional action button).
This is only happening on iOS - Android SfButton is working as expected.
Example :
I have put together some sample code where you can easily reproduce this problem.
This code sample has the following :
<Grid>
<Grid HorizontalOptions="Fill" HeightRequest="300" BackgroundColor="Lime" ColumnDefinitions="1*,1*">
<Button Margin="10,40" Text="Regular Button" Grid.Column="0" Command="{Binding RegularButtonClickedCommand}"/>
<buttons:SfButton Margin="10,40" Text="SyncFusion Button" Grid.Column="1" Command="{Binding SyncfusionButtonClickedCommand}"/>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding PanelClickedCommand}"
</Grid.GestureRecognizers>
</Grid>
</Grid>
And the ViewModel has these Commands defined.
public Command PanelClickedCommand => new Command(async () =>
{
Debug.WriteLine("Panel clicked");
});
public Command RegularButtonClickedCommand => new Command(async () =>
{
Debug.WriteLine("Regular Button clicked");
});
public Command SyncfusionButtonClickedCommand => new Command(async () =>
{
Debug.WriteLine("Syncfusion Button clicked");
});
As per the code above - it sends Debug to the Output window when running.
If I do the following actions on this sample on iOS :
As described above, the parent Grid is also receiving the click which is definitely not the desired result - we expect it to work exactly like the native MAUI button (or the Syncfusion button running on Android).
Are you able to please fix this issue ASAP.
thanks
Niall
Additional note - this issue is also happening when we have custom Content Template defined for our SfButton (this is actually our most common usage scenario). We need this to work for all uses of SfButton on iOS.
If you feel this would upset any existing iOS developers expecting it to work the wrong way, then if an additional property to the control was added (to allow the click to not be passed through) - then this would be a suitable workaround as well.
Hi Team
We have reviewed your query based on the provided information and have been able to reproduce the reported issue. We have fixed the reported issue on iOS "Syncfusion Button control handles the click event (via Command property) but then it also passes the gesture/tap to parent element. ", Kindly get the fixed nuget from the attachment. If you require any further information, please do not hesitate to let us know. This fix will be included in our weekly release on December 28, 2023. We appreciate your patience until then.
Custom Nuget Version: 23.2.7
Disclaimer:
Please note that we have created this patch for version 23.2.7 specifically, to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.
Note: Please clear the NuGet cache, before using the latest one.
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Ahamed Ali Nishad.
Hi Ahmed,
Thanks for fixing this so quickly. Will it also be patched into the 24.1.x stream too as we are currently switching to Vol 4 (once the other reported issues are fixed) - and will that be available for next release of that (and what is expected timeframe?).
Also note, as we are using DevOps build pipelines to build these releases for testing on devices/Release builds we need them to be available from the regular online nuget repository. I'm not sure how much work it would be to allow our pipelines to inject custom/uploaded nuget packages.
thanks
Niall
Hi Niall,
If you encounter difficulties using the custom NuGet package, we will incorporate the fix in the upcoming weekly release planned for December 28, 2023. We will let you know once the weekly nuget is released. We appreciate your patience until then.
Regards,
Ahamed Ali Nishad.
Hi Ahamed,
Thanks & I look forward to a fix for this in the official nuget packages.
Something very important however - it would be great if you could please issue new versions for both Vol 3 and Vol 4.
The reason for this is the other major bug I have raised with SfListView : https://www.syncfusion.com/forums/185913/major-bugs-in-vol-4-sflistview-24-1-24-android-initially-offscreen-items-templates-not
This SfListView bug is critical/showstopper for us (it breaks most of our App under Android) & if this SfListView bug is not resolved on Vol 4 at same time we have to hold our App back on Vol 3 & can't migrate to Vol 4.
thanks
Niall
Hi Niall,
We would like to inform you that the official NuGet package addressing the reported issue "Syncfusion Button control handles the click event (via Command property) but then it also passes the gesture/tap to the parent element" will be available in the weekly release scheduled for December 27, 2023 which contains Volume 4 release features and bug fixes.
Unfortunately, it's not feasible to provide the fix in official NuGet package for the Volume 3 version. However, if you still require support for the Volume 3 version with the fix, we can supply a custom NuGet package. To proceed with the custom NuGet package for the Volume 3 version with the fix, please provide the specific details of your Syncfusion NuGet version used in your project.
Regards,
Ahamed Ali Nishad.
Hi Niall,
We have included the fix for the reported issue "Syncfusion Button control handles the click event (via Command property) but then it also passes the gesture/tap to the parent element" in our latest weekly NuGet release v24.1.43 which is available for download ( https://www.nuget.org/ ). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.
Regards,
Ahamed Ali Nishad.