Skip to content

Clear input with extra button #357

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

Merged
merged 6 commits into from
Sep 13, 2023
Merged

Clear input with extra button #357

merged 6 commits into from
Sep 13, 2023

Conversation

karussell
Copy link
Member

@karussell karussell commented Sep 8, 2023

Replaces #356. Uses a different approach to fix the second part of #351. Partially related to #337 and #127.

Try here.

Selecting the text on focus does not seem to work on iphones and the UX with the clear button is better anyway. Mobile view:

image

Introducing this button was a bit tricky:

  1. The "blur" problem interfered once again (we tried to fix it in no onblur for smallscreen #354). Here we used the more general approach of disabling blur when a "pointer down" event is happening which seems to work better but we have to attach the "pointer down" detection not only for the autocomplete items but also for the clear button. (This replaces the "pointer cancel"-approach introduced in Current location #127)

  2. Furthermore the clear button is related to the autocomplete width and so we need another useRef to the entire inputContainer.

@karussell karussell added the enhancement New feature or request label Sep 8, 2023
@karussell karussell merged commit 484a13a into master Sep 13, 2023
@karussell karussell deleted the click_cleanup3 branch September 13, 2023 11:20
@karussell karussell added this to the 0.6 milestone Sep 13, 2023
ZeroGxMax pushed a commit to minhhpkp/graphhopper-maps that referenced this pull request Nov 12, 2024
* simpler onclick behaviour for touch devices and avoid onBlur problems for small screens

* back button on left side

* new clear text button instead of selecting text which doesn't work in Safari

* put clear button outside of input to avoid that input receives clicks from it

* revert font size to master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mobile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant