Closed shyamseshadri closed 6 years ago
Checked the other issues, (https://github.com/PeterStaev/NativeScript-Drop-Down/issues/163), this is happening even when it is not in a TabView
@PeterStaev debugged this a bit more, from what I can make out, the following is happening:
this._realizedItems[realizedViewType].get(convertView)
seems to be null. public _getRealizedView(convertView: android.view.View, realizedViewType: RealizedViewType): View {
if (convertView) {
let layout = this._realizedItems[realizedViewType].get(convertView);
if (layout) {
return layout;
}
convertView = null;
}
if (!convertView) {
// Same as before
Again, not sure of the implication of making this change though...
Hey @shyamseshadri , thanks for looking into this. Seems the problem is with this line: https://github.com/PeterStaev/NativeScript-Drop-Down/blob/master/drop-down.android.ts#L463
Last time I checked for some reason the Spinner never reused views. So this ended up making the _realizedItems
full of views that were not getting disposed but also were not used. I have to debug this a bit more and see what would be the best way to handle this.
Super, sounds good. I'm going to use my hack locally in the meantime to create my builds so its not a stopper, let me know if I can help in anyway
Happening in a NG + Nativescript App. Only tested on Android.
Seeing cases where if the selectedIndex is manipulated outside the dropdown (via Angular bindings), then the dropdown items disappear.
Have a base repro case for this at https://github.com/shyamseshadri/nativescript-dropdown-bugrepro
Used the basic Nativescript + Ng template.