-
Notifications
You must be signed in to change notification settings - Fork 582
Run SpatNav on up/down (in Android TV's WebView) #768
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
Conversation
Background:
Spatial Navigation is Chromium's DPAD-mechanics
that runs in Android WebView on Android TV and
if you run Chrome with --enable-spatial-navigation.
SpatNav runs as Chrome's default action on keydown.
Problem:
Once focus goes to a search box, DPAD_UP/DOWN
in Android TV's WebViews can not move focus
outside the search box. Focus gets trapped.
This happens because react-autosuggest *always*
prevents the default action (Spatial Navigation
in Android TV's WebViews).
Solution:
Do not prevent Spatial Navigation from running
when no suggestions are shown.
Testing done:
1) npm start
2) Quit Chrome.
3) chrome --enable-spatial-navigation
http://localhost:3000/demo/dist/index.html
4) Ensure that the arrow keys can move between
all fields and links.
bc7e2bc to
7574014
Compare
|
@aberezkin, could you review this change? It unblocks Android TV. |
|
@saltas888, could you review this change? Especially, could you apply this change locally and try it out on your web site? Does this break anything for you? |
pimterry
left a comment
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.
Hi @hugoholgersson! @moroshko gave me collaborator access too, I'm planning to do a run through of the PRs today and help clear things up a bit, thought I'd help here 😄. This would be a great fix, and would help towards closing out #522 and #602 as well. Just a couple of quick comments first.
a46126e to
dcff4e4
Compare
|
Looks great! 👍 👍 👍 |
|
Thanks @pimterry! So let's to step up the package version so we can get this change out there? :) Do you have access to publish a new version to npm? I don't... I see that https://www.npmjs.com/package/react-autosuggest mentions 10.0.2 as the last version. I don't know how this works because our |
Yep, definitely aiming to do that today, I just want to wrap up #773 first, just need to finish some of the test markups.
I do! (I think, although I haven't tested it yet)
Oh boy, that's not great. Doing so digging in https://unpkg.com/browse/react-autosuggest@10.0.2/ to https://unpkg.com/browse/react-autosuggest@10.0.1/ and looking through the commits from back in May, it looks like 9f1ce67 was published as 10.0.2, but that package.json commit is on a branch, and not on the merged commit on master (which is here 43bd217). It's on the PR branch for #740, but committed & pushed after the branch was already merged, easy mistake to make. I think it's probably best to leave the github tags as they are, given that (since there really is a correct 10.0.2 tag), but yes we should update straight to 10.0.3 when we release proper. |
|
Now published 👍 |
Run SpatNav on up/down (in Android TV's WebView)
Background:
Spatial Navigation is Chromium's DPAD-mechanics
that runs in Android WebView on Android TV and
if you run Chrome with --enable-spatial-navigation.
SpatNav runs as Chrome's default action on keydown.
Problem:
Once focus goes to a search box, DPAD_UP/DOWN
in Android TV's WebViews can not move focus
outside the search box. Focus gets trapped.
This happens because react-autosuggest always
prevents the default action (Spatial Navigation
in Android TV's WebViews).
Solution:
Do not prevent Spatial Navigation from running
when no suggestions are shown.
Testing done:
http://localhost:3000/demo/dist/index.html
all fields and links.