I use a search box in a modal window which is invoked by using a keyboard shortcut. But the focus is not on the input field of the search box when invoked.
Hi @arunnbabu81,
that is a beautiful edition you made there.
The idea to be able to switch layouts completely by keyboard is very usefull, but i am struggling with this also.
There are some things I do not know yet: How to have a shortcut not related to an editText-field that only works in a certain layout or under a certain condition?
eg. it would be practical to be able to close a modal by pressing escape.
I changed this part of the code in this tiddler to include focus="yes"
But still the focus is not on the input field of the search box in the modal when it’s invoked using the keyboard shortcut.
I was also looking for a similar solution as I am trying to get rid of a bunch of custom code in my project. After banging around on it for about a day, I have come up with a slight hack that doesn’t depend on any custom coding.
$action-sendmessage will emit any string as a message.
Place this within a triggering element like $button set to emit a custom message.
Wrap the button with a $messagecatcher that will listen for this custom message which will then fire off a tm-focus-selector message that targets your $edit-text class.