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: 163
Joined: Thu Nov 07, 2013 5:50 pm
Location: Montreal
Contact:

Keyboard focus on search tool

Unread post by Ed Hawco » Wed Sep 05, 2018 8:44 pm

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: 265
Joined: Mon Nov 22, 2004 11:45 pm

Re: Keyboard focus on search tool

Unread post by Tim Frost » Wed Sep 05, 2018 9:30 pm

Seconded. This has always annoyed me, but never quite enough to ask for it to be fixed.

Simon_Dismore
Posts: 156
Joined: Thu Jul 13, 2017 2:57 pm

Re: Keyboard focus on search tool

Unread post by Simon_Dismore » Wed Sep 05, 2018 11:45 pm

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: 21611
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Keyboard focus on search tool

Unread post by Tim Green » Thu Sep 06, 2018 8:52 am

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: 163
Joined: Thu Nov 07, 2013 5:50 pm
Location: Montreal
Contact:

Re: Keyboard focus on search tool

Unread post by Ed Hawco » Thu Sep 06, 2018 3:39 pm

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

Post Reply