Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Android frameStack empty on some devices #95

Open
@ScottAtRedHawk

Description

@ScottAtRedHawk

Hi,
I've come across and issue where theframeStack is empty on some Android devices. I'm not sure if this an issue fornativescript-vue-navigator ornativescript-vue or neither and something else is in my code is causing this issue. But I'll explain anyway and hopefully it'll help others at least.

Starting here

returnthis.$navigateTo(matchedRoute.component,options)
.catch(err=>console.log(`[Navigator] Failed to navigate:${err}`))

Whenthis.$navigate is called we go into its definition athttps://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L69.

On line 77 (https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L77), we callgetFrameInstance. Then go to its definition athttps://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L37.

On line 32 (https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L32), when the result ofrequire('@nativescript/core').Frame.getFrameById(frame) isundefined, causingundefined to be assigned to theframe variable.

The later call involvingframe.id (https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L37) throws an errorCannot read property 'id' of undefined and causes the navigation to never work.

Work around:

/// navigation.mixin.jsimport{isAndroid}from'@nativescript/core';importVue,{navigateTo,NavigationEntryVue}from'nativescript-vue';importComponentfrom'vue-class-component';@ComponentexportdefaultclassNavigationMixinextendsVue{public$navigator_navigate_override(route:string,options:NavigationEntryVue):navigateTo{if(isAndroid){// HACK: Android is broken on some devicesoptions={        ...options,frame:{nativeView:{id:options.frame||'navigator'}}};}returnthis.$navigator.navigate(route,{      ...options});}}

Which will get aroundframe.id being undefined when thenavigator frame should always be defined when using thenativescript-vue-navigator plugin.

Possibly associated to:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp