-
-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2963: Add support for double click events in CEF #3040
Conversation
I think we shouldn't test such things with jQuery. I have modified your script to do not use jQuery and also handle index.html<html>
<head>
<title>CEF Test</title>
</head>
<style>
div {
width: 100%;
color: #ccc;
margin-top: 10vh;
text-align: center;
font-size: 30px
}
</style>
<body style="background: #222;">
<div>Click anywhere</div>
<div class="output" style="color: rgb(184, 49, 49); margin-top: 25px;"></div>
<script>
function log(message) {
console.log(message);
document.querySelector('.output').innerHTML += '<br>' + message;
}
addEventListener("mousedown", (event) => {
log("mousedown @" + new Date().getTime());
});
addEventListener("mouseup", (event) => {
log("mouseup @" + new Date().getTime());
});
addEventListener("dblclick", (event) => {
log("double click @" + new Date().getTime());
});
addEventListener("click", (event) => {
log("click @" + new Date().getTime());
});
</script>
</body>
</html> |
Tested and it works but I don't understand why Chromium can't handle it by own? From https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event:
Possibly because because it doesn't fire mousedown for next click? This is what double clicking prints on master:
This is what slow double clicking prints (on master):
This is what Chrome prints when fast double clicking:
|
Can you review your comments above please @lopezloo as I'm fairly certain this PR fixes the issue in the correct way, and is working as intended, as discussed on Discord: https://discord.com/channels/801330706252038164/801411628600000522/1111735006142939136 |
It works but it still looks strange to me that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default value necessary? From what I see you never rely on it.
Resolves #2963
As mentioned in the issue description above, double click events previously weren't being sent to CEF.
Test resource:
cef.zip
Usage: start the resource & click your mouse. a status (
single
ordouble
click) will be displayed on the browser page, as well as in the console