Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25068] iOS: multiple nested views with labels inside do not appear to handle click events as expected

GitHub Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionNeeds more info
Resolution Date2017-08-08T20:55:19.000+0000
Affected Version/sRelease 6.1.2
Fix Version/sn/a
ComponentsiOS
Labelsclickevent, labels, views
ReporterPeter Lancaster
AssigneeHans Knöchel
Created2017-08-04T13:29:00.000+0000
Updated2017-08-08T20:55:19.000+0000

Description

Running the latest SDK (6.1.2) - it appears that nesting *Label* elements multiple layers down within *View* elements can cause the label text tap / touch / click events to not bubble up to their parent elements in some scenarios. In effect, this causes a 'dead space' of the text in a given row being the only untouchable element.
<!-- appending an event to open a new controller on rowThatIsTouchable works as expected - with the entire visible UI of the label and the image, and the containing element, being 'touchable' and handling the event correctly -->

<View id="rowThatIsTouchable" accessibilityLabel="rowThatIsTouchable" top="0" bottom="0" height="Ti.UI.SIZE" layout="composite">
  <Label id="rowThatIsTouchableLabel" accessibilityLabel="rowThatIsTouchableLabel" textAlign="left" left="0" />
  <ImageView right="0" />
</View>

<!-- appending an event to open a new controller on rowWithLabelThatIsUntouchable does not work as expected - with everything except the label being 'touchable' and handling the event correctly -->

<View id="rowWithLabelThatIsUntouchable" accessibilityLabel="rowWithLabelThatIsUntouchable" top="0" bottom="0" height="Ti.UI.SIZE" layout="composite">
  <View top="0" left="0" layout="vertical" height="Ti.UI.SIZE">
    <View width="Ti.UI.FULL" height="Ti.UI.SIZE">
      <Label id="rowWithLabelThatIsUntouchableLabel" accessibilityLabel="rowWithLabelThatIsUntouchableLabel" textAlign="left" left="0" />
      <ImageView right="0" />
    </View>
  </View>
</View>

Comments

  1. Hans Knöchel 2017-08-08

    Hey [~plancaster], does this only happen with 6.1.2 or also on 5.5.x and 6.0.x? We will need to create a full test-case before looking into this, but it will be looked at this sprint! *EDIT*: The sample code cannot be used to reproduce the issue. It has no click listeners and no context to be tested in. Please either attach a sample project or classic Titanium code (containing a full window that holds this view-hierarchy). *EDIT 2*: The demo-code provided has some more issues: * No label text, just a blank view is displayed. * Major layout issues: You are using both "top: 0", "bottom: 0" and Ti.UI.SIZE together - the top/bottom specs will fill the layout to the top/bottom edges, but the Ti.UI.SIZE with size it to it's parent again. * The accessibility-labels are unrelated and should not be part of the demo-code * You use Ti.UI.FULL instead of Ti.UI.FILL (typos) We cannot handle this ticket for now and need more infos about it beforehand, thanks!

JSON Source