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

Sometimes clicking on an item in the autocomplete list is broken #351

Closed
karussell opened this issue Aug 14, 2023 · 1 comment
Closed

Sometimes clicking on an item in the autocomplete list is broken #351

karussell opened this issue Aug 14, 2023 · 1 comment
Labels
bug Something isn't working firefox This issue only occurs in Firefox

Comments

@karussell
Copy link
Member

karussell commented Aug 14, 2023

  1. Sometimes when I click on an item in the autocomplete list (in firefox) it shows the marker on the map but won't change the input with the text of the item. It is currently reproducible when I initially have this URL and type 'hoyersw' in the first input field and click on the first result of the autocomplete (which would be the same text as in the URL Hoyerswerda - Wojerecy).

  2. On mobile there is a similar but more critical issue as because of this problem the location is not even shown on the map. I had the feeling that this happened for lighter touches (!?)

Update: the 2nd problem seems to be that we have a special handling for touch events in AutocompleteEntry. I think instead we should rely on onclick even for mobile devices because an additional click event is additionally generated (by the browser) for certain touch events (with unchanged x+y position).

But currently this additional click event is not created because:

  1. the onBlur method of AddressInput interferes and
  2. we call e.preventDefault() for onPointerDown in AutocompleteEntry.

(For onBlur: because setHasFocus(false) hides the suggestion just before the touchend is created and therefor the autocomple item is "moved away under the finger" and the click event isn't generated. To see what is going on you can trigger the click event when removing all touch and pointer related handling in AutocompleteEntry and then removing the onBlur method. )

Update: was able to debug the 2nd problem on a mobile device (with eruda) and it seems that no onTouchEnd and no onClick is called when this happens (only touchStart+pointerDown). Maybe this is just a firefox problem? I was able to reproduce this on another Android device with firefox, but not yet on chrome.

@karussell karussell added the bug Something isn't working label Aug 14, 2023
@karussell karussell added the firefox This issue only occurs in Firefox label Aug 29, 2023
@karussell
Copy link
Member Author

The second part should be fixed via #357 (or #354 before). Created a new issue for the first part: #358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working firefox This issue only occurs in Firefox
Projects
None yet
Development

No branches or pull requests

1 participant