question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bring back the cancel icon for search fields

See original GitHub issue

Usually, when defining <input type="search"/>, there is a cancel button to the right of the text field: image In Bootstrap, this is overwritten, causing the cancel button to be not visible. This was discussed 4-6 years ago already here https://github.com/twbs/bootstrap/issues/5624. However, now that meanwhile also normalize.css chose to include the cancel icon back (https://github.com/necolas/normalize.css/issues/685) and the cancel icon is now present in every browser, I would suggest to add it back.

I feel like this is too much of an important feature to remove it for style reasons. One alternative I would also consider would be to add a class that would either add the cancel button back or remove the cancel button, if we would decide to change the standard behavior to have the cancel button shown by default.

What do you think? I would implement the change, once we agreed on the details.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
XhmikosRcommented, Dec 27, 2018

Told you I couldn’t find any references 😉

0reactions
kcs-shahbajshaikhcommented, Oct 17, 2022

input[type=“search”]::-webkit-search-cancel-button {

/* Remove default */ -webkit-appearance: none;

/* Now your own custom styles / height: 14px; width: 14px; display: block; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAn0lEQVR42u3UMQrDMBBEUZ9WfQqDmm22EaTyjRMHAlM5K+Y7lb0wnUZPIKHlnutOa+25Z4D++MRBX98MD1V/trSppLKHqj9TTBWKcoUqffbUcbBBEhTjBOV4ja4l4OIAZThEOV6jHO8ARXD+gPPvKMABinGOrnu6gTNUawrcQKNCAQ7QeTxORzle3+sDfjJpPCqhJh7GixZq4rHcc9l5A9qZ+WeBhgEuAAAAAElFTkSuQmCC); / setup all the background tweaks for our custom icon */ background-repeat: no-repeat;

/* icon size */ background-size: 14px;

}

Read more comments on GitHub >

github_iconTop Results From Across the Web

webkit-search-cancel-button - CSS: Cascading Style Sheets
The ::-webkit-search-cancel-button CSS pseudo-element represents a button (the "cancel button") at the edge of an <input> of type="search" which ...
Read more >
Editing input type="search" Pseudo-element Button ('x')
Here is a cross-browser implementation of the Clear Search "x" button, It uses the solid times-circle SVG from FontAwesome for the icon and ......
Read more >
How to change the "cancel(erase)" X icon in the Guide Search ...
Hi, I would like to know if anyone knows how to specifically change or style the "X" icon that clears the Search Input...
Read more >
Input Type Search Clear Button Gone · Issue #5624 - GitHub
When an input element is created of type "search", the clear button that is created ... Bring back the cancel icon for search...
Read more >
How to remove annoying icons in Windows Search ... - YouTube
Join this channel to get access to perks: https://www.youtube.com/channel/UCmWNCO9wSjzOz1UV8jCvIHA/join Windows 10 Pro OEM GLOBAL CD-KEY USE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found