简体   繁体   中英

Why doesn't this work on iPad?

It properly works on all browsers, just on iPad safari. If I emulate as iPad user agent on the browser, it just works fine.

http://jsfiddle.net/NMcuy/38/embedded/result/

The problem is that If I type text (Add Text), the keyboard in iPad shows, I can press keys, but it doesn't show in the draggable div. Even the default text stays the same.

I don't know that the problem is :(

function newText()
{
var note = new Note();
note.id = ++highestId;

var text = document.createElement('textarea');
text.name = "text";
text.setAttribute("onkeyup", "textAreaAdjust(this)");
text.setAttribute("class", "text");
//text.innerHTML = initialText;
note.contentField.appendChild(text);

note.name = note.id + "_text";
note.left = Math.round(Math.random() * 400) + 'px';
note.top = Math.round(Math.random() * 500) + 'px';
note.zIndex = ++highestZ;
note.saveAsNew();
}

According to my research this is a bug/(specific feature) in iOS regarding focus (or delagating focus) events. This was dropped afterwards.

Mobile Safari Autofocus text field

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM