Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25937

Android: Horizontal TextField scrolling should not be canceled by scrollable parent view

    Details

    • Story Points:
      3
    • Sprint:
      2018 Sprint 07 SDK, 2018 Sprint 08 SDK

      Description

      Summary:
      When a TextField is within a vertical ListView, ScrollView, or TableView... horizontal TextField scrolling will be canceled if you drag your finger too far up/down and the vertically scrolling parent view will steal/intercept all touch events from there. This makes scrolling a TextField difficult.

      Expected Behavior:
      Once horizontal scrolling has started in a TextField, the parent view should no longer be able to scroll vertically until your finger has been released.

      Steps to Reproduce:

      1. Build/run the below code on Android.
      2. Start dragging a TextField horizontally.
      3. As you drag it horizontally, drag up or down.
      4. Notice that the TextField no longer scrolls horizontally and you're now vertically scrolling the parent ScrollView instead.

      var window = Ti.UI.createWindow();
      var scrollView = Ti.UI.createScrollView(
      {
      	showVerticalScrollIndicator: true,
      	layout: "vertical",
      });
      for (var index = 1; index <= 20; index++) {
      	var row = Ti.UI.createView(
      	{
      		layout: "horizontal",
      		width: Ti.UI.FILL,
      		height: Ti.UI.SIZE,
      	});
      	row.add(Ti.UI.createLabel(
      	{
      		text: "Row " + index.toString(),
      		left: "5dp",
      	}));
      	row.add(Ti.UI.createTextField(
      	{
      		value: "Welcome to the Appcelerator Platform! The Appcelerator Platform helps you develop cross-platform mobile applications using the Titanium SDK, Alloy, Appcelerator Studio and the Appcelerator CLI, then lets you manage the entire lifecycle of the application with debugging, testing, deploying, crash monitoring and analytic data collection.",
      		left: "5dp",
      		right: "5dp",
      		width: Ti.UI.FILL,
      		height: Ti.UI.SIZE,
      	}));
      	scrollView.add(row);
      }
      window.add(scrollView);
      window.open();
      

      Notes:

      • A vertical scrolling TextArea does not have this problem since it supports "nested" scrolling.
      • iOS does not allow horizontal scrolling of a TextField at all while in a vertically scrolling parent, but I don't think we should match this behavior on Android since it makes it less convenient to use.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code