모바일 사파리, Android 브라우저 및 Android 용 Firefox ("Fennec")에서 보이는 효과가 버그 또는 예상되는 동작인지 파악하려고합니다. 기본적으로 <input>
요소는 사용자가 원래 탭하지 않은 경우에도 특정 시나리오에서 <input>
요소가 키보드 포커스를받을 수 있다는 점입니다. 모바일 브라우저에서이것은 버그입니까? 요소를 두드리면 다른 요소가 키보드 포커스를받을 수 있습니다.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, user-scalable=no">
<style>
#screenCover {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.3);
z-index: 1;
}
#newItemInput {
position: absolute;
width: 200px;
height: 20px;
}
</style>
</head>
<body>
<div id="screenCover"></div>
<input id="newItemInput" type="text">
<script type="text/javascript" language="JavaScript">
var screenCoverEl = document.getElementById("screenCover"),
newItemInputEl = document.getElementById("newItemInput");
newItemInputEl.value = String(navigator.userAgent);
screenCoverEl.addEventListener("touchend", function (event) {
// Move the <input> element in the way.
newItemInputEl.style.top = (event.changedTouches[0].clientY - 10) + "px";
newItemInputEl.style.left = (event.changedTouches[0].clientX - 10) + "px";
// Hide the screen cover. Note that the screen cover was the original target of the tap.
screenCoverEl.style.display = "none";
}, false);
newItemInputEl.addEventListener("click", function (event) {
this.setSelectionRange(0, this.value.length);
}, false);
</script>
</body>
</html>
직접 : 여기서
가 재현 테스트 케이스 인이 예에서http://fiddle.jshell.net/f7TKc/2/show/
, 스크린 커버 위에 놓여 문서,하지만 touchend
에 화면 덮개가 숨겨져 <input>
요소가 이동되었습니다. 사용자가 스크린 커버를 두드린 곳까지 Mobile Safari, Android Browser 및 Fennec 13.0b1에서 <input>
요소는 키보드 포커스를 받아 들일 수 없습니다.
에뮬레이터 내에서 충돌하기 때문에 새 버전의 Fennec에서이를 테스트 할 수 없습니다.
이것은 버그입니까? 예상되는 동작입니까?
HTTP : //code.google.com/p/android/issues/detail? id = 6721? – Slartibartfast