-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigator
: move focus while navigating between screens
#37063
Comments
Personally, I'm not sure we'd need to restore the focus on the previous clicked link — focusing the whole "screen" should be enough (as it generally happen when going to the previous page in a browser via its standard history) |
This should be the case already with the |
Exactly, that's why I wrote:
I'm wondering if the current behaviour is not enough already |
I see this behaviour for a list of Items comparable to toolbar items opening dropdowns — the expectation is when you close the dropdown the item that opened it is focused, not that it resets to the whole toolbar. Imagine the case with the list of blocks, which can be anywhere from 20+ to 100. You are making modifications to a blocks in sequence, but every time you go back it resets focus. It'd be pretty annoying. |
If we do need to implement this behaviour, it means that we need to start passing/storing state when a route changes (as explained also by @diegohaz here). This potentially means that we'd need to keep a navigation history inside the internal On top of that, we'd need to understand what's the best format for that "identifier" |
Or we could also think about it more broadly as cases where focus needs to be transferred because an interface session "ended". An interface can "end" by closing a popover, closing a modal, closing a sidebar, deleting a block, and also navigating back from a panel to its parent panel. That means perhaps the state we need to store is not at the Navigator level but at the general UI level. |
I've implemented a potential solution in a draft #37223. It still requires polishing, but it's definitely at a stage where we can judge if it's an approach that we want to implement or discard |
Closing as focus restoration was initially implemented in #38149 and later refined |
In #36952 (comment), @mtias bring up the issue that the _ "back" links need the ability to focus the element they represent when you go back,_
I'm trying to summarise the questions that we need to answer here:
There's a few questions to be solved:
NavigatorScreen
should already be able to move the focus on its own wrapperdiv
when mounted.Navigator
component?Navigator
component, should we re-consider adopting a third-party routing solution?cc @diegohaz @youknowriad @mirka
The text was updated successfully, but these errors were encountered: