Skip to content

Commit 63074bc

Browse files
committed
fix: make generate button focusable
1 parent 176a418 commit 63074bc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/popup/addEditInterface.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,13 @@ function AddEditInterface(settingsModel) {
490490
? helpersUI.highlight(loginObj.fields.secret)
491491
: ""
492492
),
493-
m("div.btn.generate", {
493+
m("div.btn.generate[tabindex=0]", {
494494
title: "Generate password",
495-
onclick: () => {
496-
loginObj.setPassword(
497-
loginObj.generateSecret(passwordLength, symbols)
498-
);
499-
passwordGenerated = true;
495+
onclick: () => generateSecret(loginObj),
496+
onkeydown: (e) => {
497+
if (e.code == "Space") {
498+
generateSecret(loginObj)
499+
}
500500
},
501501
}),
502502
]),

src/popup/colors.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
.addEdit,
4848
.details {
4949
.btn {
50+
&.generate {
51+
background-color: @edit-bg-color;
52+
}
53+
5054
&:hover,
5155
&:focus {
5256
background-color: @hover-bg-color;
5357
}
54-
55-
&.generate {
56-
background-color: @edit-bg-color;
57-
}
5858
}
5959

6060
.contents {

0 commit comments

Comments
 (0)