Closed eskalVAR closed 4 years ago
Did some digging into code (I know NDA is required hence specifics will not be provided)
In ui-listview-android.js
line 270 and line 539. The issue is to do with how duplicate event firing checks are handled.
A temporary workaround is just remove the check. This does mean the itemSelecting event is fired twice after 1 tap though. Any information on what calls ListViewAdapter.canSelect
would be great to find out why this double firing event occurs.
Thanks for the information. We will take a look and release a fix with the next listview plugin update.
Hi, A new version of RadListView was recently released (8.1.2) that includes a fix for the onItemSelecting/onItemDeselecting behavior. Give it a try and see if it works as expected.
Your fix works, thank you for getting it done so quickly.
Versions CLI: 6.5.0 tns-android: 6.5.0 nativescript-ui-listview: 8.11
Description When using the RadListView from
nativescript-ui-listview/vue
the itemSelecting event does not fire again if the same item is twice after setting thereturnValue
of the event toHow to reproduce + details I am trying to limit the number of items that can be selected in a RadListView using the following code:
Say the max items is 3. Upon selecting the 4th item (say index 6) the returnValue stops the 4th item from being selected and the itemSelecting event is fired. If another item (say index 10) is tapped on it also works. This method does not stop selection if the same item is taped consecutively.
If the same item is tapped a few times the following happens:
Tap 1 : itemSelecting event fired, itemSelected NOT fired, selection stops Tap 2 : itemSelecting event NOT fired, itemSelected fired, selection succeeds Tap 3 : itemSelecting event fired, itemSelected NOT fired, selection stops Tap 4 : itemSelecting event NOT fired, itemSelected fired, selection succeeds
..... and continues like this
I have only tested this on android, both on my personal device and an emulator.
The RadListView is populated using the
for
property and a standard JS object.