Bug 59113 - Button click doesn't fire with scroll and keyboard open
Summary: Button click doesn't fire with scroll and keyboard open
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-30 14:55 UTC by Lawrence
Modified: 2018-01-18 19:35 UTC (History)
3 users (show)

Tags: button, event, scroll, keyboard, ac
Is this bug a regression?: ---
Last known good build:


Attachments
Zipped up demo solution (596.56 KB, application/x-zip-compressed)
2017-08-30 14:55 UTC, Lawrence
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 59113 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Lawrence 2017-08-30 14:55:33 UTC
Created attachment 24480 [details]
Zipped up demo solution

Overview: More detailed restatement of summary.

Clicking on a button with the keyboard opened and focused to a entry field with the scroll view scrolled down a bit doesn't trigger the button event in a nested layout.  The button's event does fire in a simple layout say just a single stacklayout.

Steps to Reproduce: Minimized, easy-to-follow steps that will trigger the bug. Include any special setup steps.

1) Create ContentPage as follows:
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="250" />
                <RowDefinition Height="*" />
                <RowDefinition Height="120" />
            </Grid.RowDefinitions>
            <Label
                Grid.Row="0"
                Text="Header"
                VerticalOptions="Center" />
            <StackLayout
                Grid.Row="1"
                Margin="0,32,0,15"
                Orientation="Vertical"
                Spacing="0">
                <StackLayout HeightRequest="92">
                    <Label Text="Email" />
                    <Entry Placeholder="Enter your email" />
                </StackLayout>
                <StackLayout HeightRequest="92">
                    <Label Text="Password" />
                    <Entry IsPassword="True" Placeholder="Enter your password" />
                    <Label Text="Forgot Your Password?" TextColor="Red" />
                </StackLayout>
            </StackLayout>

            <StackLayout Grid.Row="2" Orientation="Vertical">
                <Button
                    Margin="0,0,0,16"
                    BackgroundColor="Blue"
                    Clicked="BtnTest_Clicked"
                    Text="Submit"
                    TextColor="White" />
                <Button
                    Margin="0,0,0,16"
                    BackgroundColor="Red"
                    Text="Visit Us"
                    TextColor="White" />
            </StackLayout>
        </Grid>
    </ScrollView>

2) Load the content page on the phone or simulator, click on the entry and type in some text (with the keyboard still open and focus is on the entry) try to press on the Submit button.

The keyboard dismisses, the view gets scrolled back up.  But the button click event doesn't fire.

Expected Results: 
The Submit button's click event should have fired along with the keyboard dismissing and the view scrolling.

Build Date & Hardware: Date and hardware of the build in which you first encountered the bug.

Xamarin.Forms 2.4.0.269-pre2
Visual Studio Enterprise 2017 15.4.0 Preview 1.0
Xamarin 4.7.0.827
Xamarin.iOS and Xamarin.Mac SDK 10.14.0.4

Additional Builds and Platforms: Whether or not the bug takes place on other platforms (or browsers, if applicable).

Doesn't appear to happen in Android, only in iOS

Additional Information: Any other useful information. 
I have a screen capture of it happening: https://vimeo.com/231651730
I clicked the Submit button a total of 5 times.  The first 2 times were with the keyboard open and describes this bug.  The 3rd and 4th time were just normal button clicks (works as expected).  The 5th time was with the keyboard open again.
Comment 1 Paul DiPietro [MSFT] 2017-08-30 15:20:07 UTC
Thanks for providing a reproduction project; I'll set this to confirmed for now as it occurs with the provided 2.4.0-pre2 build as stated (as well as the stable build).
Comment 2 Victor 2018-01-18 19:35:21 UTC
As a work around, using a label with a gesture recognizer will work instead of a button.