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

Changing a property on nested object causes ordering problems #177

Open
kryptus36 opened this issue Jun 24, 2020 · 6 comments
Open

Changing a property on nested object causes ordering problems #177

kryptus36 opened this issue Jun 24, 2020 · 6 comments
Labels

Comments

@kryptus36
Copy link

Which platform(s) does your issue occur on?

  • iOS/Android/Both

Only tested on android

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)

6.7.4

  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)

6.5.1

  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)

Android 6.5.0

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

"dependencies": {
"@nativescript/theme": "^2.2.1",
"nativescript-pager": "^12.0.0-alpha.8",
"nativescript-vue": "^2.6.1",
"tns-core-modules": "^6.5.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.1.0",
"nativescript-dev-webpack": "^1.5.1",
"nativescript-vue-template-compiler": "^2.6.0",
"nativescript-worker-loader": "~0.11.0",
"node-sass": "^4.13.1",
"tns-platform-declarations": "^6.5.1",
"typescript": "^3.8.3",
"@types/node": "^13.11.1",
"vue": "^2.6.11",
"vue-loader": "^15.9.1"
}

Please, tell us how to recreate the issue in as much detail as possible.

I've created a simple bingo card as an example. There is an array of 5 bingo cards in the pager, each has some spaces daubed and some not.

Here's the really odd part: tapping a space triggers the toggleDaub method, and it seems to work fine on cards index 0 & 1. But try it on cards 2,3,4 and the cards at the end get moved to the beginning -- even though the ordering of the array itself has not changed.

May be related to https://stackoverflow.com/questions/58451314/adding-items-dynamically-in-nativescript-pager-screws-up-view-order

Is there any code involved?

https://github.com/kryptus36/ns-pager-ordering

@triniwiz
Copy link
Owner

Hi have you tried binding to a observablearray ?

@kryptus36
Copy link
Author

I just tried now (code is pushed to above repo). Unfortunately the results are the same.

@triniwiz
Copy link
Owner

Thanks .. can you run it on iOS if not that’s ok

@triniwiz triniwiz added the bug label Jun 24, 2020
@kryptus36
Copy link
Author

Ah - that's interesting. Works as expected on iOS.

@kryptus36
Copy link
Author

Just as a note, it breaks similarly on iOS if you don't use the ObservableArray.

Thanks for your quick replies!

@triniwiz
Copy link
Owner

@kryptus36 I gave the ObservableArray more love since it has changeEvents which made things a bit easier and more performant i'll throw something together soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants