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

Use type="search" for search input #322

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

jonathanhefner
Copy link
Member

This was originally attempted in 88a61ab but reverted in 68dbaf6 due to an extra magnifying glass icon being shown in Webkit-based browsers.

This commits changes the search input to use type="search", and adds the necessary CSS to hide the native magnifying glass icon.

Before After
before after

This was originally attempted in 88a61ab
but reverted in 68dbaf6 due to an extra
magnifying glass icon being shown in Webkit-based browsers.

This commits changes the search input to use `type="search"`, and adds
the necessary CSS to hide the native magnifying glass icon.
All other icons that we use are from [Feather icons][feather].  So, for
visual consistency, this commit replaces the search input icon with the
equivalent icon from Feather icons v4.29.0.

The icon is [licensed under the MIT license][license].

[feather]: https://feathericons.com/
[license]: https://github.com/feathericons/feather/blob/v4.29.0/LICENSE
Webkit-based browsers can display a "clear search" button for
`type="search"` inputs.  However, browsers style the button
inconsistently, and some do not display it without additional CSS.

This commit adds CSS to ensure the "clear search" button is displayed
consistently in Webkit-based browsers.
@jonathanhefner jonathanhefner merged commit 0fdcc77 into rails:main Oct 5, 2023
8 checks passed
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.

1 participant