mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

CEF doesn't properly capture certain characters (Cyrillic uppercase "Л")

Open JeViCo opened this issue 2 years ago • 2 comments

Describe the bug

CEF acts weird when trying to type a capital cyrillic letter "Л" into the focused input. It doesn't happen with any other cyrillic or latin letter. I don't know if there's more letters like this in other languages.

It could be reproduced in both GUI and non GUI browsers. Tested on local server on Win10 and Win11. It doesn't happen on Win7 though.

Steps to reproduce

  1. Enable browser logging: setDevelopmentMode(true, true);
  2. Create any kind of browser and add text input to it;
  3. Focus that input;
  4. Try typing any letter and then a capital letter "Л".

It could be easily detected by using:

function onDOMContentLoaded() {
    const myInput = document.querySelector(".myInput"); // use querySelector or getElementById

    elements.input.addEventListener("keydown", (e) => console.log(1, e.key));
    document.addEventListener("keypress", (e) => console.log(2, e.key));
}
document.addEventListener("DOMContentLoaded", onDOMContentLoaded);

AND

elements.input.addEventListener("input", (e) => console.log(3, event.target.value));

OR (equivalent to previous one)

<input type="text" class="myInput" oninput="console.log(this.value)" />

Version

Client: v1.6-release-22268, Win10 & Win11

Additional context

No response

Relevant log output

No response

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not security related.

JeViCo avatar Oct 23 '23 18:10 JeViCo

Hey There,

function onDOMContentLoaded() {
    const myInput = document.querySelector(".myInput"); 

    // observe any unusual behavior
    myInput.addEventListener("keydown", (e) => {
        console.log("Keydown event:", e.key, e.keyCode);
    });

    myInput.addEventListener("keypress", (e) => {
        console.log("Keypress event:", e.key, e.keyCode);
    });

    // track changes in the input value
    myInput.addEventListener("input", (e) => {
        console.log("Input event:", e.target.value);
    });
}

document.addEventListener("DOMContentLoaded", onDOMContentLoaded);
  • If doesn't work, try to see if it has something to do with the enconding, by default it comes "utf-8", check that on your html file in the head tag.

TMachadoDev avatar Feb 13 '24 11:02 TMachadoDev

Hi, I had same problem with CEF WPF until I upgraded CEF to the latest version (122.1.12+g6e69d20+chromium-122.0.6261.112).

alexeev-igor avatar Mar 16 '24 00:03 alexeev-igor

Just tested on nightly build r22485 and issue is gone

JeViCo avatar Jun 03 '24 12:06 JeViCo