Autoclear search box?

User Help for Mozilla Firefox
Post Reply
Ed1
Posts: 1064
Joined: January 30th, 2005, 2:33 pm

Autoclear search box?

Post by Ed1 »

I am using FF129.02. Previously, when conducting a search using the separate search box dragged onto the main toolbar, the box itself would clear the entered terms when the search results appeared.

Now, the search terms are not automatically cleared, requiring the user to use the backspace key to clear out the box.

Is there a way to get the autoclear behavior back?
User avatar
therube
Posts: 21807
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Autoclear search box?

Post by therube »

(115 ESR behaves the same, the search term is retained.
That said, I have no idea if it every behaved differently as I've never used the Search Box before.)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
semigeek
Posts: 340
Joined: April 16th, 2014, 8:54 pm
Location: Colorado

Re: Autoclear search box?

Post by semigeek »

I think this behavior changed quite some time ago. It's just a cosmetic problem; if you click the box again, the old text is selected so you can just type something else to overwrite it (no need to backspace). So my approach was to write CSS to make it invisible when the cursor isn't in the box.

Code: Select all

#searchbar:not(:focus-within):not(:hover) *|input {opacity: 0 !important;}
Ed1
Posts: 1064
Joined: January 30th, 2005, 2:33 pm

Re: Autoclear search box?

Post by Ed1 »

OK, thanks, everyone. I'll try that code.
Ed1
Posts: 1064
Joined: January 30th, 2005, 2:33 pm

Re: Autoclear search box?

Post by Ed1 »

Thanks, @semigeek . That code works to clear the search box after a search. But when clicking back in the box to do another search, the prior search text appears again and is highlighted in blue. Typing a space or a letter clears it again, but that is what happens anyway without the code.
User avatar
dickvl
Posts: 54228
Joined: July 18th, 2005, 3:25 am

Re: Autoclear search box?

Post by dickvl »

That CSS code only hides the content from viewing (changes the opacity from 1 to 0) and doesn't clear the content what would require JavaScript and is no longer possible.
semigeek
Posts: 340
Joined: April 16th, 2014, 8:54 pm
Location: Colorado

Re: Autoclear search box?

Post by semigeek »

Ed1 wrote: September 4th, 2024, 11:18 am ...when clicking back in the box to do another search, the prior search text appears again and is highlighted in blue. Typing a space or a letter clears it again, but that is what happens anyway without the code.
Yes, that's what I said. You can't actually get rid of it with css, but you can hide it, and it's not an obstacle to entering new text.
Agent virtuel
Posts: 314
Joined: January 27th, 2019, 2:58 am

Re: Autoclear search box?

Post by Agent virtuel »

Hello

Maybe? and, of course, if you'd like to try
https://github.com/Endor8/userChrome.js ... Term.uc.js
Copy/paste the code (e.g.) into Notepad
Save
Type: All files
ucjs_ClearSearchTerm.uc.js

Take a look at https://mozhelp.ddnss.de/dateien/forum/ ... kripte.mp4
https://github.com/Endor8/userChrome.js ... me#hinweis download and unpack the ZIP file

Demonstration with Mozilla Firefox, Portable Edition
https://portableapps.com/apps/internet/firefox_portable

Image

https://www.youtube.com/embed/DGs75LGMpvk
Post Reply