Fix first focus issue on opening browser action. Fixes #564
This commit is contained in:
parent
e467988a71
commit
9903e811c2
1 changed files with 7 additions and 1 deletions
|
@ -523,8 +523,14 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
|
||||||
/* Not sure why extensions require a focus for the doorhanger,
|
/* Not sure why extensions require a focus for the doorhanger,
|
||||||
however it allows us to have a tabindex before the first selected item
|
however it allows us to have a tabindex before the first selected item
|
||||||
*/
|
*/
|
||||||
document.addEventListener("focus", () => {
|
const focusHandler = () => {
|
||||||
list.querySelector("tr").focus();
|
list.querySelector("tr").focus();
|
||||||
|
document.removeEventListener("focus", focusHandler);
|
||||||
|
};
|
||||||
|
document.addEventListener("focus", focusHandler);
|
||||||
|
/* If the user mousedown's first then remove the focus handler */
|
||||||
|
document.addEventListener("mousedown", () => {
|
||||||
|
document.removeEventListener("focus", focusHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
|
Loading…
Add table
Reference in a new issue