Keyboard focus on search tool

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Ed Hawco
Posts: 165
Joined: Thu Nov 07, 2013 5:50 pm
Location: Montreal
Contact:

Keyboard focus on search tool

Unread post by Ed Hawco »

Hello. This is an odd one, brought to my attention by a heavy users of my documents. When you click the magnifying glass icon in the TOC area to bring up the search tool, you then have to manually click in the search field before typing your search term.

Request: is there a way to have the search field automatically have keyboard focus when the search tool is opened? For example, the way Google or DuckDuckGo search fields automatically have focus when those web pages are loaded.

Asking for a friend. ;-)
e
d
============================================
Ed Hawco
Tim Frost
Posts: 319
Joined: Mon Nov 22, 2004 11:45 pm

Re: Keyboard focus on search tool

Unread post by Tim Frost »

Seconded. This has always annoyed me, but never quite enough to ask for it to be fixed.
Simon_Dismore
Posts: 205
Joined: Thu Jul 13, 2017 2:57 pm

Re: Keyboard focus on search tool

Unread post by Simon_Dismore »

There's probably a cleaner method but but you can hack a quick fix like this:
  • Find an instance of zoom_search.js, e.g. in your existing WebHelp output folder
  • Copy the file somewhere it won't be overwritten
  • Open it in a code editor and locate function ZoomShowSearchBox()
  • Put the editing caret after a space in document.writeln("...") so that a new attribute can be added
  • Insert autofocus=\"autofocus\"
  • Save the updated version
  • Each time you recompile your WebHelp, copy the updated version into the output folder, overwriting the compiler-generated version
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Keyboard focus on search tool

Unread post by Tim Green »

Interesting, that is not something I've ever even noticed. I think I've been using computers for so long that clicks like that are second nature and I don't even think about them. 8)

I'm going to update this in the custom versions of zoom_search.js in the Premium Pack skins in the next update but I can't promise whether this will happen for the standard version of the file used in the standard skins or default templates without skins. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Ed Hawco
Posts: 165
Joined: Thu Nov 07, 2013 5:50 pm
Location: Montreal
Contact:

Re: Keyboard focus on search tool

Unread post by Ed Hawco »

Thanks Tim! Appreciated!
e
d
============================================
Ed Hawco
Post Reply