blob: 48a6ad725a606893337dadae254a3e69427e4de4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../../resources/js-test.js"></script>
<script src="../../../../resources/ui-helper.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
}
textarea, #target {
width: 100%;
height: 100px;
position: absolute;
top: 0;
}
#target {
background-color: tomato;
z-index: 1;
opacity: 0.25;
}
textarea {
opacity: 0;
}
#description {
margin-top: 100px;
}
</style>
</head>
<body>
<textarea></textarea>
<div id="target"></div>
<pre id="description"></pre>
<pre id="console"></pre>
</body>
<script>
jsTestIsAsync = true;
textarea = document.querySelector("textarea");
target = document.getElementById("target");
target.addEventListener("touchstart", event => event.preventDefault());
description("Verifies that the keyboard shows up even after preventing default on touchstart when focusing a hidden editable area. To manually test, tap the red box; the textarea should remain focused, and the keyboard should appear.");
addEventListener("load", async () => {
textarea.focus();
await UIHelper.activateElementAndWaitForInputSession(target);
testPassed("keyboard was shown.");
shouldBe("document.activeElement", "textarea");
textarea.blur();
await UIHelper.waitForKeyboardToHide();
finishJSTest();
});
</script>
</html>