-
Notifications
You must be signed in to change notification settings - Fork 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
SiteSelector: Remove selector state binding #14028
Conversation
0917665
to
f05c8f0
Compare
|
||
return path; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Are there precendents of such thunks that never dispatch any action and instead only call
getState
and perform some side effect (in this case,page
call)?
Note that, in the future, if we add middleware-level routing support (e.g. dispatch( { type: 'NAVIGATE', path } )
, the above becomes a "normal" thunk which calls getState
in order to have sufficient data to then dispatch
a routing request.
- The remaining question: given its nature, where should this action creator live?
f05c8f0
to
bc970a4
Compare
I'm not sure if I'm doing something wrong when testing, but it doesn't seem to work for me. Neither it hightlights the site on mouse over or the keyboard navigation works... Am I missing something? :/ |
@johnHackworth, this is what you should be seeing: First I'm moving my mouse and hovering over sites, then I switch to Up/Down arrows on my keyboard. |
maybe chrome/linux related? |
It's working on all of Firefox, Chrome, and Safari on my Mac. It may be Linux-related. |
Hmm, I've just tested and it works fine in firefox/linux ... it looks like it's a chrome/linux (Versión 56.0.2924.87 (64-bit) ) issue |
Frees component from needing special access to Redux state.
bc970a4
to
caf8478
Compare
I was the original author of keyboard navigation for this component. With this fix in place, it looks like we have the desired behavior working again. Thanks for fixing it :) Regarding the code, I like the move of navigation code out of the compoenent and making it an action. Not sure where it should live to be honest… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality works and I'm fine merging as-is, unless we have more usages for navigation actions or you just wanna dig deeper. Once we have more, it might be a good idea to collocate them.
For now, I honestly wouldn't mind to leave it there, as it's very component-specific and doesn't |
Agreed, but let's move. Thanks for the review! |
Part of #14024
Also fixes keyboard navigation in SiteSelector, a feature knowingly broken in #13094 and introduced in #5808.
Testing
Try to switch sites, select all sites, etc., in different Calypso sections. Try to switch sites with the mouse, the keyboard, both. Site switching should continue to work as expected; keyboard navigation should now be working properly, e.g.: