ui-material-components icon indicating copy to clipboard operation
ui-material-components copied to clipboard

[Bottom-navigation][android] Frame.topmost().navigate doesn't work when activity resumed

Open kefahB opened this issue 3 years ago • 9 comments

Hi,

On android if the app just start every think work as expected, but when the app is in background and then it resumed the Frame.topmost().navigate wont work until you change the tabs then the navigate will be triggered!

Please found this sample project

  1. open the app and click on TAP ME
  2. it is expected to navigate to the PAGE TEST 2 successfully
  3. Go back to home
  4. put the app on background and reopen it
  5. click on TAP ME: then the navigation will not occur any more!!

kefahB avatar Jan 16 '22 14:01 kefahB

@farfromrefug did you have any idea about this behavior ?

kefahB avatar Jan 16 '22 20:01 kefahB

@kefahB absolutely not . And i am sorry but i realy dont have time to investigate this. Hope you can

farfromrefug avatar Jan 16 '22 21:01 farfromrefug

I tried for the whole day today but I really understand no think :)

kefahB avatar Jan 16 '22 21:01 kefahB

@farfromrefug how can I get the source code in TS ? when I navigate to packages/bottom-navigation I dont see the sources code ! I mean there is no index.ios.ts, index.androis.ts....

kefahB avatar Jan 16 '22 21:01 kefahB

it is in src. this is a monorepo. the packages folder is for the output odf the build

farfromrefug avatar Jan 16 '22 22:01 farfromrefug

@farfromrefug I think I got the error but am not sure, the problem occur if the selectedView instanceof Frame.

When the app is loaded for the first time every think work as expected selectedView.isCurrent() return true.

But when you click on home button and reopen the app selectedView.isCurrent() return FALSE ! I've tried to do some stuff with selectedView.setCurrent but not work for the moment !

Any Idea ?

Look here for the Frame

kefahB avatar Jan 17 '22 15:01 kefahB

@kefahB thanks for investigating. i just dont understand your isCurrent reference. dont see that code

farfromrefug avatar Jan 17 '22 19:01 farfromrefug

The code doesn't exist .. I've add during the investigation

const selectedView = newItem && newItem.content;
        if (selectedView instanceof Frame) {
            selectedView._pushInFrameStack();
            console.log("isCurrent", selectedView.isCurrent())
            console.log("navigationQueueIsEmpty", selectedView.navigationQueueIsEmpty())
            console.log("isUserInteractionEnabled", selectedView.isUserInteractionEnabled)
            console.log("isLayoutValid", selectedView.isLayoutValid)
            console.log("isLoaded", selectedView.isLoaded)
            console.log("_isInFrameStack", selectedView._isInFrameStack)
            if(!selectedView.isCurrent()) {
                selectedView.setCurrent(selectedView._currentEntry, 1);
            }
            console.log("isCurrent", selectedView.isCurrent())
            //selectedView._pushInFrameStack();
        }

kefahB avatar Jan 17 '22 19:01 kefahB

@kefahB isCurrent() is not a correct test. it takes an argument. What you see : true => false is 100% normal

farfromrefug avatar Jan 17 '22 20:01 farfromrefug