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

SearchBox: Fix broken flyTo on mobile #574

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Sep 20, 2024

Description

Reported in #523

Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Sep 20, 2024 3:32pm

@Dlurak Dlurak enabled auto-merge (squash) September 20, 2024 15:31
@Dlurak Dlurak merged commit 860786b into zbycz:master Sep 20, 2024
2 checks passed
@Dlurak Dlurak mentioned this pull request Sep 20, 2024
9 tasks
(setPreview: (feature: unknown) => void) => (_: never, option: Option) => {
(setPreview: (feature: unknown) => void) =>
(_: never, option: Option, reason: AutocompleteHighlightChangeReason) => {
if (reason === 'touch') return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain what was the issue here? I know it sometimes needed a double click, though I don't understand why this should help. (Though it helps! 🎉 😃 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first click on the option runs the highlight callback. The second clicks then ran the actual click listener.
Actually I also don't fully understand why instantly returning fixes this issue 😅 but it does and now we just return when the click was from a touch device.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.. on click is like a hover on mobile. That makes sense! THX

instantly returning fixes the issue

That almost looks like some mobile magic.. 😅 aka "if callback takes shorter than something, lets skip it .. apple is known for that 🙃

@Dlurak Dlurak deleted the searchbox-flyto-mobile branch September 30, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants