Mobile / Fix board default scrolling position #2475
Merged
+6
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
When rendering a board the collapsible-columns controller tries to restore which columns the user left expanded. That state is saved in
localStorage.The controller goes through
localStoragefor each column (using an"expand-{board}-{column}"key) looking for atruevalue, then proceeds to expand the ones for which it did found a localStorage item, collapses all the other ones.On mobile, that's only 1 column at a time, calling
expand()on it scrolls it into view.If no previously expanded column is found in
localStorage, it'll default to Maybe, collapse all the other columns but doesn't callsexpand()on the Maybe column, which is rendered expanded by default by the view.Problem
On mobile it means if you visit a board for the first time, or even several times without ever manually expanding a column, no localStorage value is ever set,
expand()is not called on any column, not scrolling any into view 👇Fix
Call
expand()when falling back on the Maybe column in mobile mode.