mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Fire a pointer event on synthetic clicks
This commit is contained in:
parent
1e2ddf9848
commit
db0519ddc1
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/shannonbooth
Commit: db0519ddc1
Pull-request: https://github.com/SerenityOS/serenity/pull/23886
Reviewed-by: https://github.com/kennethmyhra ✅
3 changed files with 18 additions and 3 deletions
15
Tests/LibWeb/Text/input/HTML/HTMLElement-click.html
Normal file
15
Tests/LibWeb/Text/input/HTML/HTMLElement-click.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script src="../include.js"></script>
|
||||
<button id="myButton"></button>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
function handleClick(event) {
|
||||
println(`Event: ${event.constructor.name}`);
|
||||
done();
|
||||
}
|
||||
|
||||
let button = document.getElementById("myButton");
|
||||
|
||||
button.addEventListener("click", handleClick);
|
||||
button.click();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue