Delphi Version: 10.3
CEF Version: 87.1.12
Windows Version: Windows 10 Enterprise 64 Bit (vm on Macbook Pro 2019 i7-9750H 32Gb Ram)
Step by step guide to reproduce the error:
- Open a page using a CEF module
- Change to an other tab or Windows application
- Change back to the previous CEF module
- Try to press a button and handle the event without clicking the page first
Code: Select all
<html>
<head>
<script>
window.onload = function(){
document.addEventListener('keydown', function (e) {
if (e.ctrlKey) {
document.getElementById('testcontainer').style.backgroundColor = 'rgb(253, 166, 166)';
}
});
document.addEventListener('keyup', function (e) {
document.getElementById('testcontainer').style.backgroundColor = 'red';
});
}
</script>
<style>
div {
width: 200px;
height: 70px;
padding: 10px;
text-align: center;
vertical-align: center;
font-size: 50px;
background-color: red;
color: white;
margin: 50px;
}
p {
font-weight: bold;
font-size: 20px;
}
</style>
</head>
<body>
<div id='testcontainer'>
CTRL
</div>
<p>
Press the CTRL button to change the container color. If you change the tab or windows-process and change back, it will not work, unless you click the page. It works fine in Google Chrome and other Chromium based browsers.
</p>
</body>
</html>