chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.23k stars 456 forks source link

windows: Popup not focused correctly with multi-threaded-message-loop #3481

Open SB97 opened 1 year ago

SB97 commented 1 year ago

Describe the bug When opening a PopUp with an Input element that gets focus it is not working.

Triage for this problem started at: https://github.com/cefsharp/CefSharp/discussions/4457#discussioncomment-5578348

To Reproduce The Call:

<button class="button" onClick="window.open('test.php','fenster','popup');">
     <span class="icon">Open PopUp</span>
</button>

The Popup:

<body>
<form action="/action_page.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value="John"><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value="Doe"><br><br>
  <input type="submit" value="Submit">
</form> 

</body>

<script>
       document.getElementById("fname").focus();
</script>

cefclient.exe --multi-threaded-message-loop --no-sandbox

Open the main File and click the Button. Start typing.

Expected behavior Popup opens and the fname input field has focus.

cefclient.exe --multi-threaded-message-loop --no-sandbox --use-default-popup does this.

Versions (please complete the following information):

Additional context Does the problem reproduce with the cefclient or cefsimple sample application at the same version?

Does the problem reproduce with Google Chrome at the same version?

Add any other context about the problem here.

magreenblatt commented 1 year ago

Possibly related to #3436