dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

[iOS] SwipeView fails when wrapping an Editor control #14699

Open smithbower opened 1 year ago

smithbower commented 1 year ago

Description

Wrapping an Editor control with a SwipeView on iOS causes the SwipeView to respond inconsistently. The Editor doesn't get resized or translated properly and therefore overlaps with the SwipeItem, which will not react to taps.

Wrapping an Entry control works as expected. Wrapping an Editor control works as expected on Android.

Here is a demonstrative gif from the iOS 16.4 Simulator: maui_editor

Steps to Reproduce

  1. Create a File-> New -> Dotnet MAUI app
  2. Create a new SwipeView control that wraps an Editor with the following code:
<SwipeView>
     <SwipeView.RightItems>
        <SwipeItem Text="Delete" BackgroundColor="Red" Invoked="OnCounterClicked"/>
     </SwipeView.RightItems>

     <Grid>
         <Editor Text="Editor"/>
     </Grid>
</SwipeView>
  1. Start the app on iOS device or simulator
  2. Swipe the Editor control to reveal the Delete SwipeItem
  3. Attempt to click the SwipeItem
  4. Observe that the OnCounterClick method is not called

Link to public reproduction project repository

https://github.com/smithbower/dotnet_maui_swipeview_editor_bug

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.4

Did you find any workaround?

No response

Relevant log output

No response

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on iOS 16.4 with below Project: SwipeViewEditor.zip