Skip to content

Conversation

@danielroe
Copy link
Collaborator

No description provided.

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 30, 2026 3:48pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Jan 30, 2026 3:48pm
npmx-lunaria Ignored Ignored Jan 30, 2026 3:48pm

Request Review

:placeholder="$t('search.placeholder')"
v-bind="noCorrect"
:autofocus="!isMobile"
:autofocus="autofocus"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need the autofocus if we are manually focusing on mount?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for client side navigation - without it it doesn't focus when navigating from index to search page

but I'm very up for other ideas!

Copy link
Contributor

Choose a reason for hiding this comment

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

A dodgy mechanism I looked at implementing was watching the route. Then if the new route.name was search but old one was not, it would focus the searchbox. Might be able to do the same thing here just include the touch part? Although if you are starting search on home screen on mobile you likely want to be auto focused to search to complete it.

I don't know vue/vue router enough to know if on direct nav to search if oldRoute has a value or not.

return (
'ontouchstart' in window ||
navigator.maxTouchPoints > 0 ||
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this rather be @ts-expect-error?

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.

3 participants