closing a confirm or alert box with escape prevents fields to be accessed (chrome,edge)

Viewed 619

when I execute the following page, from Windows 10 using any of the following browsers:

  • Microsoft Edge Version 85.0.564.44 (Official build) (64-bit)
  • Brave Version 1.13.82 Chromium: 85.0.4183.83 (Official Build) (64-bit)
  • Google Chrome Version 85.0.4183.83 (Official Build) (64-bit)

From the snippet below, if I press the hello or hallo button and close the popup by pressing the escape key, I will no longer be able to focus the text field. In firefox or Internet Explorer 11, however, I do not encounter this behaviour.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>abc</title>  
</head>
<body>

<button onclick="confirm('hehe');">hello</button>
<button onclick="alert('haha');">hallo</button>
<input id="AddressSupp1" maxlength="60" name="AddressSupp1" type="text" value="" />

</body>
</html>

why is this happening ? is this a bug from Chrome/Chromium ? Does anyone know of any workarounds ? Closing the popup by clicking on the cancel button does not yield this buggy behaviour. According to my BrowserStack tests, it behaves like this since Chrome 83, it was fine in Chrome 81, and possibly before (there are only so many versions I could be bothered to test). Thanks!

1 Answers
Related