The new navigation state restoration changes are g...
# compose
j
The new navigation state restoration changes are great. One issue(?) we’ve noticed is
LazyColumn
scroll position will not be saved if both of these conditions are met: • A screen with a
LazyColumn
instantiates a ViewModel with
hiltViewModel()
• An item in the
LazyColumn
references an unstable object (i.e. a navController) Is this expected?
j
The new navigation state restoration changes are great
What exactly are you referring to by this?
j
Unfortunately I don’t think this is related. The issue is reproducible without any flows involved. I’m specifically referring to the new
saveState
and
restoreState
properties on
NavOptionsBuilder
When I set these properties to true while navigating between bottom tabs, I would expect scroll positions to persist across tab changes (which they do, unless the circumstances I described in the OP are met)
j
@Ian Lake I wonder if/how this relates to https://twitter.com/ianhlake/status/1388517293005574144?s=21
i
j
@Ian Lake Does this sound related to this or would you like me to submit a separate issue?
i
That's the exact bug linked in the first reply in that conversation 🙂
👍 1