enisn / Xamarin.Forms.InputKit

CheckBox, Radio Button, Labeled Slider, Dropdowns etc.
MIT License
579 stars 98 forks source link

Using a checkbox within a ScrollView should not change checked state from scroll events #368

Open Kas-code opened 3 months ago

Kas-code commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Try the provided xaml, this uses checkboxes within a ScrollView.
  2. Increase the number of checkboxes and labels so that you have enough content to be larger than your device's screen size which will make the ScrollView scroll when dragging up and down (basically just anything to provide enough content to be able to scroll)
  3. When you drag content in the ScrollView up and down, this makes the ScrollView scroll up and down, but if you tap on the text of a checkbox to scroll up and down, then this checks the checkbox

Expected behavior

Checkboxes should not get checked when the user is dragging the screen to scroll. The checkbox should only check or uncheck when the tap event comes from a non-scroll event.

It's very inconvenient to users if they have to be selective about which parts of the screen they can drag on to scroll. They should be able to drag on any part of the screen to scroll up and down, without having to worry about acidentally checking a checkbox.

<ScrollView>
    <VerticalStackLayout>
              <Label Text="Test test test" />
          <input:CheckBox Text="Test test test" />
          <Label Text="Test test test" />
          <input:CheckBox Text="Test test test" />
          <Label Text="Test test test" />
          <input:CheckBox Text="Test test test" />
          <Label Text="Test test test" />
          <input:CheckBox Text="Test test test" />
    </VerticalStackLayout>
</ScrollView>