Skip to content
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

leaving input with tab should work (keyboard navigation) #54

Closed
karussell opened this issue Apr 7, 2021 · 5 comments · Fixed by #88 or #112
Closed

leaving input with tab should work (keyboard navigation) #54

karussell opened this issue Apr 7, 2021 · 5 comments · Fixed by #88 or #112
Labels
enhancement New feature or request
Milestone

Comments

@karussell
Copy link
Member

karussell commented Apr 7, 2021

When I type a location in the first input, then "tab" into second, then type a location in the second input and hit return it should show the route. Currently it is required that I select a location from both suggestion lists to update the route.

Also when copy and pasting a location as coordinate it does not route although no geocoding needs to be done.

@karussell karussell added the enhancement New feature or request label Apr 7, 2021
@karussell karussell changed the title leaving input field and return should trigger update leaving input field and pressing enter should trigger update Apr 7, 2021
@karussell karussell changed the title leaving input field and pressing enter should trigger update pressing enter should trigger update Apr 7, 2021
@karussell karussell added this to the 0.3 milestone Apr 7, 2021
@karussell karussell mentioned this issue May 14, 2021
14 tasks
@karussell
Copy link
Member Author

karussell commented Jun 3, 2021

The "keyboard-only" use case I had in mind with this issue still does not work properly: leaving the input via "tab" does not resolve the input via geocoding. (I should have explained this better what I had in mind )

Additionally the focus is not in the "start"-input and does not switch to "destination"-input when pressing "tab" like graphhopper.com/maps currently does. E.g. try: open the URL, type "hamburg", press tab, type "munich", press enter.

@karussell karussell reopened this Jun 3, 2021
@karussell karussell changed the title pressing enter should trigger update leaving input with tab should work (keyboard navigation) Jun 3, 2021
@karussell karussell removed this from the 0.3 milestone Jun 3, 2021
@Janekdererste
Copy link
Collaborator

So currently graphhopper.com/maps doesn't select anything from the autocomplete when tab is pressed in the search field. Somehow it finds a location anyway. (It even resolves ";klj" to a location :-)) So far we are more restrictive in maps2, meaning we only query a route when a geocoding result is selected.

Do you want to select the first geocoding result when tab is pressed, or something else? The former is easy to do, only the tab order of the app would have to change. The latter would require more work I think.

@karussell
Copy link
Member Author

It is not high prio btw :)
But yes, if no location is selected and tab is pressed I would pick the first location.

currently graphhopper.com/maps doesn't select anything from the autocomplete

Yes, the old version queries even queries nominatim instead of photon if the result is not picked from autocomplete (autocomplete comes from photon). This works quite well in practise (as nominatim is a bit better than photon but has no auto complete feature) but might be too ugly for our new version.

@easbar
Copy link
Member

easbar commented Jun 8, 2021

Maybe like this:

  1. enter start location -> autocomplete suggestions are shown and can be selected with up/down arrows or mouse OR we press tab or click somewhere in which case the suggestions list closes and the user input is left untouched
  2. enter target location -> same thing really
  3. Press Enter -> if autocomplete suggestions were picked, use them. otherwise either send geocoding to nominatim or use the input text directly in case it is a lat,lon pair.

So basically the same as on graphhopper.com/maps :) I think this works quite well?! It's maybe a bit ugly that to use the better geocoder (nominatim) we need this 'workaround' of not selecting from the autocomplete list, but honestly I never even noticed this so far and with this workflow it also feels natural to enter GPS coordinates.

One thing we could improve compared to graphhopper.com/maps: If I type something and then press enter before the autocomplete suggestions appear the cursor will be in the destination input box, but the suggestions for the start location are shown anyway and I cannot see the destination box anymore.

@karussell
Copy link
Member Author

It works when initially "tab" was pressed, but it is broken if I don't use the keyboard initially and paste a coordinate in the input and then press "tab", then the focus goes to the custom model button instead of the next location. Related to #267.

@karussell karussell reopened this Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants