Skip to content

Instantly share code, notes, and snippets.

@uhyo
Last active August 16, 2024 09:11
Show Gist options
  • Save uhyo/ed8b23fa723be9c12b396aa7a315fa28 to your computer and use it in GitHub Desktop.
Save uhyo/ed8b23fa723be9c12b396aa7a315fa28 to your computer and use it in GitHub Desktop.
Google Chrome top layer bug repro
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>repro</title>
<style>
#popover1 {
top: 100px;
left: 100px;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<dialog id="dialog1">
Dialog1
</dialog>
<div popover="manual" id="popover1">
Popover1
</div>
<script>
const popover1 = document.getElementById('popover1');
const dialog1 = document.getElementById('dialog1');
dialog1.showModal();
popover1.showPopover();
dialog1.close();
// Uncommenting the following line will fix the issue
// await new Promise(resolve => setTimeout(resolve, 0));
dialog1.showModal();
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment