Skip to content

Commit 225a264

Browse files
calebebyGpx
authored andcommitted
fix: add focus event for checkbox/radio
BREAKING CHANGE: a focus event is now fired when clicking on checkbox and radio elements
1 parent e3b9fbc commit 225a264

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

__tests__/react/click.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe("userEvent.click", () => {
5959
"mouseover",
6060
"mousemove",
6161
"mousedown",
62+
"focus",
6263
"mouseup",
6364
"click",
6465
"change"
@@ -115,6 +116,7 @@ describe("userEvent.click", () => {
115116
"mouseover",
116117
"mousemove",
117118
"mousedown",
119+
"focus",
118120
"mouseup",
119121
"click",
120122
"change"

__tests__/react/dblclick.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe("userEvent.dblClick", () => {
6464
"mouseover",
6565
"mousemove",
6666
"mousedown",
67+
"focus",
6768
"mouseup",
6869
"click",
6970
"change",

__tests__/vue/click.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe("userEvent.click", () => {
7272
"mouseover",
7373
"mousemove",
7474
"mousedown",
75+
"focus",
7576
"mouseup",
7677
"click",
7778
"change"
@@ -140,6 +141,7 @@ describe("userEvent.click", () => {
140141
"mouseover",
141142
"mousemove",
142143
"mousedown",
144+
"focus",
143145
"mouseup",
144146
"click",
145147
"change"

__tests__/vue/dblclick.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ describe("userEvent.dblClick", () => {
7676
"mouseover",
7777
"mousemove",
7878
"mousedown",
79+
"focus",
7980
"mouseup",
8081
"click",
8182
"change",

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function clickBooleanElement(element) {
3636
fireEvent.mouseOver(element);
3737
fireEvent.mouseMove(element);
3838
fireEvent.mouseDown(element);
39+
fireEvent.focus(element);
3940
fireEvent.mouseUp(element);
4041
fireEvent.click(element);
4142
}
@@ -72,6 +73,7 @@ function dblClickCheckbox(checkbox) {
7273
fireEvent.mouseOver(checkbox);
7374
fireEvent.mouseMove(checkbox);
7475
fireEvent.mouseDown(checkbox);
76+
fireEvent.focus(checkbox);
7577
fireEvent.mouseUp(checkbox);
7678
fireEvent.click(checkbox);
7779
fireEvent.mouseDown(checkbox);

0 commit comments

Comments
 (0)