forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: can dispatch events with the type they want. (cypress-io#8305)
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
- Loading branch information
1 parent
2469473
commit 15fdf12
Showing
5 changed files
with
160 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<title>Test input event</title> | ||
</head> | ||
<body> | ||
<input id="test-input"/> | ||
<div id="result"></div> | ||
</body> | ||
<script> | ||
let elem = window.document.getElementById('test-input'); | ||
let resultDiv = window.document.getElementById('result'); | ||
elem.addEventListener('keydown', (event) => { | ||
resultDiv.innerText = `isKeyboardEvent: ${event instanceof KeyboardEvent}`; | ||
}); | ||
elem.addEventListener('mousedown', (event) => { | ||
resultDiv.innerText = `isMouseEvent: ${event instanceof MouseEvent}`; | ||
}); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters