Side Panel Automatic Focus

78 views
Skip to first unread message

akalias

unread,
Jan 15, 2024, 3:47:59 AM1/15/24
to Chromium Extensions
You can click on the action icon and have it automatically focus in an input/textarea

Why can't we do the same for the side panel?

Is there any chance this can be "fixed" ?

Stefan Van Damme

unread,
Jan 15, 2024, 5:14:10 AM1/15/24
to Chromium Extensions, akalias
Hi there,

Have you tried this in your "panel.html" page?
 document.addEventListener('DOMContentLoaded', function () {
      setTimeout(function () {
        document.getElementById('myInput').focus();
      }, 500);
    });

Thanks,
Stefan vd

Jackie Han

unread,
Jan 15, 2024, 5:01:50 PM1/15/24
to akalias, Chromium Extensions
There is no way to implement this feature at the moment. Because when opening the side panel, the focus doesn't move to the side panel page.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/50cb4cb7-013f-482b-9808-742ca5cb11een%40chromium.org.

Jason Savard

unread,
8:39 AM (5 hours ago) 8:39 AM
to Chromium Extensions, Jackie Han, Chromium Extensions, akalias
I confirm this issue still exists, if it can't be focused automatically, can we at least have a way to programmatically focus it with the chrome.sidePanel API?

I see there is a ticket opened for this: https://issues.chromium.org/issues/40896667
Reply all
Reply to author
Forward
0 new messages