GestureSample icon indicating copy to clipboard operation
GestureSample copied to clipboard

[iOS] Bug: Button in Grid, Clicked is not triggered

Open TomQv opened this issue 8 months ago • 0 comments

With MR.Gestures 5.0, Maui Net 8, the following ContentPage:

public class GridButtonBug : ContentPage
    {
        public GridButtonBug()
        {
            var btnTest = new Button { Text = "Test", HorizontalOptions = LayoutOptions.Center , VerticalOptions = LayoutOptions.Center};
            btnTest.Clicked += async (s, e) => await DisplayAlert("Alert", btnTest.Text, "OK"); 

            var grid = new MR.Gestures.Grid();
            grid.Add(btnTest);

            // when this event is added, btnTest.Clicked is not triggered anymore
            // only on iOS, on Windows and Android its fine
            grid.Panning += (s, e) =>
                Debug.WriteLine("Panning " +  (int)e.DeltaDistance.X + " " + (int)e.DeltaDistance.Y );

            Content = grid;
        }
    }

Adding the Panning-event to the grid breaks btnTest.Clicked. Its not called anymore. Adding other events like Down, Panned also breaks btnTest.Clicked. This is only on iOS. On Android and Windows, this works fine.

Thank you for looking into it.

TomQv avatar Jun 05 '24 19:06 TomQv