Assigned
Status Update
Comments
mo...@google.com <mo...@google.com> #2
This actually has nothing to do with NavHostFragment, but is the behavior of NavController's setGraph().
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
jr...@google.com <jr...@google.com> #3
Turns out, we already had a tracking bug for this issue, will follow up on that other one.
ra...@google.com <ra...@google.com> #4
Thank you for promptly replying to my report. You are right that the issue you've just mentioned is similar to mine. I shall continue observing the progress over there.
ra...@google.com <ra...@google.com> #5
On second thought, Anastasia might have more context as she implemented the links feature
Description
I've encountered a bug in Compose related to focus and clickable links within an AnnotatedString. Specifically, when two clickable spans are present in the string, and the user navigates from the second link to the first using the left arrow key, the first link does not visually display a focus indicator.
While it appears as if focus is lost, the first link is indeed focused. This can be confirmed by pressing the Enter key, which triggers the toast "Clicked on link!" associated with the first link. The visual focus indicator, however, is missing.
Here is a minimal reproducible example