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

site: add type="search" to search input #9263

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

sanjaiyan-dev
Copy link
Contributor

Hi, a minor accessibility improvement has been made by adding type="search" to the input tag.

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2023

⚠️ No Changeset found

Latest commit: 7a028bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Reading https://adrianroselli.com/2019/07/ignore-typesearch.html it sounds like there's little to no benifit or may actually make matters worse in some cases. What arguments are there for adding type="search" in your opinion? @geoffrich do you have any additional insights?

sites/svelte.dev/src/routes/+layout.svelte Outdated Show resolved Hide resolved
@sanjaiyan-dev sanjaiyan-dev changed the title Enhancing Accessibility: Improved Input Tag with 'type="search"' in docs 🖊 Enhancing Accessibility: Improved Input Tag with type="search" in docs 🖊 Oct 19, 2023
@benmccann benmccann changed the title Enhancing Accessibility: Improved Input Tag with type="search" in docs 🖊 site: add type="search" to search input Oct 19, 2023
@benmccann benmccann added the site label Oct 19, 2023
@benmccann
Copy link
Member

It looks like there's typically visible differences for the majority of users when using type="search": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search#differences_between_search_and_text_types. However, I can't see such differences in Chrome, which I suspect is because of the CSS we've applied meaning that there probably are no differences other than whatever accessibility differences might exist

@geoffrich
Copy link
Member

It seems like the accessibility benefits of adding type="search" are minimal, but I don't think it really hurts anything. This page is not used much anyway - it's a fallback page when JS isn't available for the search modal.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Thanks!

@dummdidumm dummdidumm merged commit 522d06a into sveltejs:master Oct 20, 2023
6 checks passed
@sanjaiyan-dev sanjaiyan-dev deleted the sanjaiyan-input-docs branch October 20, 2023 19:06
@benmccann
Copy link
Member

I pushed the same commit to SvelteKit: sveltejs/kit@96993cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants