Is there any way to focus the side panel document via keyboard shortcut when a webpage has focus?

27 views
Skip to first unread message

Roy Liao

unread,
8:21 AM (2 hours ago) 8:21 AM
to Chromium Extensions

I have an extension that has a search bar. I register a chrome command that allows the user to show/hide the search bar.
When the side panel is focused, fire the shortcut shows the search bar and the search input gains the foucs.
When the side panel is not focused, e.g. web page is focused, fire the shortcut shows the search bar, but search input does not gain the focus.

The code has the implementation like inputElement.focus(), and it works when side panel gains the focus. Just does not work if not.

Is there a workdaround for this? 

Lucas

unread,
9:45 AM (1 hour ago) 9:45 AM
to Chromium Extensions, Roy Liao
This is a known bug.

The good news is that https://issues.chromium.org/issues/486495151 has been marked as a fix.

In Google Chrome versions 148.0.7778.56 (release) beta and 149.0.7811.0 (release) canary, it now works correctly (the input box in the side panel correctly gains focus).
Reply all
Reply to author
Forward
0 new messages