Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listview triggers checkedChange event when using switches #569

Closed
curtiscarlson opened this issue Oct 28, 2019 · 3 comments
Closed

Listview triggers checkedChange event when using switches #569

curtiscarlson opened this issue Oct 28, 2019 · 3 comments

Comments

@curtiscarlson
Copy link

Version

2.5.0-alpha.1

Reproduction link

https://play.nativescript.org/?template=play-vue&id=EpO6YJ

Platform and OS info

Android 9 and Ios 12, nativescript playground and sidekick

Steps to reproduce

open playground app on phone. change a switch and scroll. for example, if you switch off "eight", "eight" might switch back on as you scroll, or other items may switch off.

What is expected?

the model is affected as intended

What is actually happening?

the model is changed unpredictably. As you scroll, the checkedChanged event fires unintentionally.


This is likely due to your virtual scroll implementation. If I need to change my code to make this work I am open to that. But I do not see a workaround right now because the event fires when it should not. I don't know what version the playground uses so I selected the latest version.

@curtiscarlson
Copy link
Author

curtiscarlson commented Oct 29, 2019

OK I have worked on this a little more and I don't think it has anything to do with the event firing. The listView is actively over-writing changes in the model when you scroll.

https://play.nativescript.org/?template=play-vue&id=EpO6YJ&v=7

https://play.nativescript.org/?template=play-vue&id=EpO6YJ&v=10

on the last one there, change a switch, scroll down, and change another. check the device console.

Please let me know if I am missing something?

@curtiscarlson
Copy link
Author

curtiscarlson commented Oct 29, 2019

It needed a :key property, feeling kind of embarrassed. But I will leave it up in case anybody finds this.

https://play.nativescript.org/?template=play-vue&id=EpO6YJ&v=12

@nativescript-vue-bot
Copy link
Collaborator

We are locking this issue because it has been closed for more than 14 days.

If the issue comes up again please open a new issue with additional details.

@nativescript-vue nativescript-vue locked as resolved and limited conversation to collaborators Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants