-
-
Notifications
You must be signed in to change notification settings - Fork 241
SegmentedBar *INSIDE* ListView - crashes on scrolling #900
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
Comments
From @chrisvor on July 15, 2017 6:6 The "recipe" items array is an array of type ProdIngr as below: export class ProdIngr { avl has a value of "1" if the item is "available" and "0" if not. This controls the visibility of the row in the listview. optOptions is itself an array of SegmentedBarItem, with 3 options with title "None", "Add", "Extra". Each row in the listview has a SegmentedBar showing the options (and selected option) for the individual row element (prodIngr instance) |
Hi @chrisvor, Attaching sample project, which could be used for debugging. |
Thanks for the update. I'll be on the lookout for the fix :) |
Any updates on this bug? Anything I can do to at least provide a temp fix on my setup until it is fixed in the core ? |
Bumping this issue to see if anyone had any luck with resolving this or working around it? Recently moved from NS5 with NA 8.0.3 to latest, so was definitely working as expected with 8.0.3. Oddly, the crash only happens on Android for me. |
Worked out the issue, opening a PR. |
From @chrisvor on July 15, 2017 5:47
Did you verify this is a real problem by searching [Stack Overflow]
Yes, I could not find something related
Tell us about the problem
When I use a SegmentedBar component INSIDE a ListView (i.e. as part of the template definition), when the ListView is first displayed everything is normal. As soon as I try to scroll down, at the moment that a new listview row is about to be shown, the app crashes with an error:
"Error: View already has a parent. View: [object Object] Parent: SegmentedBar(252)".
I suspect this has something to do with the recycling functionality that exists in the ListView control, and somehow when the new row is about to be displayed by recycling the one just gone off the screen, the SegmentedBar control that was inside the "old" instance is not properly "cleared" so that a new parent can be assigned to it, hence the error.
Which platform(s) does your issue occur on?
iOS
Android not tested
Please provide the following version numbers that your issue occurs with:
"dependencies": {
"angular/animations": "~4.1.0",
"angular/common": "~4.1.0",
"angular/compiler": "~4.1.0",
"angular/core": "~4.1.0",
"angular/forms": "~4.1.0",
"angular/http": "~4.1.0",
"angular/platform-browser": "~4.1.0",
"angular/router": "~4.1.0",
"nativescript-angular": "^3.1.1",
"nativescript-couchbase": "^1.0.18",
"nativescript-theme-core": "^1.0.4",
"reflect-metadata": "~0.1.8",
"rxjs": "^5.4.2",
"tns-core-modules": "^3.1.0",
"zone.js": "~0.8.2"
}
(note: in the list above I removed the "@" prefix on the "angular" dependencies as it wasn't showing in this post)
Please tell us how to recreate the issue in as much detail as possible.
Just populate the items array with more than what would fit on the screen and scroll the listview
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
Copied from original issue: NativeScript/NativeScript#4556
The text was updated successfully, but these errors were encountered: