Skip to content

Commit b9dc946

Browse files
authored
Merge pull request #353 from nativescript-community/fix/tabs-fragmentmanager
fix(tabs): use relative fragment manager
2 parents 684379f + 1c1afdf commit b9dc946

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/tabs/tabs.android.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ function initializeNativeClasses() {
164164
}
165165

166166
instantiateItem(container: android.view.ViewGroup, position: number): java.lang.Object {
167-
//@ts-ignore
168-
const fragmentManager = this.owner._getRootFragmentManager();
167+
const fragmentManager = this.owner._getFragmentManager();
169168
if (!this.mCurTransaction) {
170169
this.mCurTransaction = fragmentManager.beginTransaction();
171170
}
@@ -202,8 +201,7 @@ function initializeNativeClasses() {
202201

203202
destroyItem(container: android.view.ViewGroup, position: number, object: java.lang.Object): void {
204203
if (!this.mCurTransaction) {
205-
//@ts-ignore
206-
const fragmentManager = this.owner._getRootFragmentManager();
204+
const fragmentManager = this.owner._getFragmentManager();
207205
this.mCurTransaction = fragmentManager.beginTransaction();
208206
}
209207

@@ -623,8 +621,7 @@ export class Tabs extends TabsBase {
623621
}
624622

625623
private disposeCurrentFragments(): void {
626-
//@ts-ignore
627-
const fragmentManager = this._getRootFragmentManager();
624+
const fragmentManager = this._getFragmentManager();
628625
const transaction = fragmentManager.beginTransaction();
629626

630627
const fragments = this.fragments;

0 commit comments

Comments
 (0)