Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4820] ListItem does not bubble Switch Element

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-02-28T17:02:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsalloy, bindings, listitem, switch
ReporterCreative
AssigneeShak Hossain
Created2017-02-23T13:04:35.000+0000
Updated2017-02-28T17:02:22.000+0000

Description

I'm using a ListView with a custom ListItem template, however, the "itemclick" event does not trigger on the parent ListView element, when I click the Switch element which is part of the ListItem.
<Alloy>
    <ItemTemplate name="template">
            <Label id="notification" width=100 backgroundColor="#faa" bindId="notification" />
            <Switch id="toggleable" bindId="toggleable" bubbleParent="true" />
    </ItemTemplate>
</Alloy>
- Clicking the "notification" element triggers fine on the 'itemclick' event ({"bindId": "notification"} is available). - Clicking on the ListItem itself (neither clicking the Label/Switch) triggers 'itemclick', however does not give a bindId, as expected - Clicking the "toggleable" element does not trigger 'itemclick' at all Adding touchEnabled="false" to the Switch element does seem to trigger the itemclick event, however this does not change the value of the switch. In addition (unrelated to the bug), the docs do not explicitly say a "Ti.UI.View" element is supported within a ListItem (as seen in http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListItem, ctrl+f for "A list template supports the following view classes:"), however I've been using them previously and they seem to be working as intended.

Comments

  1. Creative 2017-02-23

    Update: I managed to do a workaround using {noformat} {noformat} Then the "myFunc" will be called in the associated controller with the proper event details. However this is not expected behaviour, especially when everything else in my whole application has event listeners attached through the controller namespace ($.myobj.addEventListener...)
  2. Sharif AbuDarda 2017-02-23

    Hello, Please share a full sample code that regenerates the behavior without the workaround. If the bug is real we will fix it ASAP. Create a sample code only to demonstrate the issue. Thanks.
  3. Creative 2017-02-23

    Unfortunately I cant spend the 2 hours needed to create a contained testcase. I'm already losing much time on creating workarounds for very basic features
  4. Sharif AbuDarda 2017-02-24

    Hello, We need to validate the bug before we can move to fixing.

JSON Source