The code is as Nativescript PlayGround
It is a sample code that user can mark an item in the listview by clicking the heart.
Everything works expectedly when the listview scrollDirection is “Vertical” as line 35 in the XML. When change to “Horizontal” as line 34, two bugs(?) happens.
- It gets “undefined” when I try to get “heart_4” as line 86 by click the button “Test”. But if scroll to “EEE” then click, it can get the object and heart will be marked.
- When tap the heart of “AAA”, it will be marked. However, the hearts of “D”, “G”, “J” are also marked.