HTML5 contenteditable属性在iOS7 Mobile Safari上无法正常运行 [英] HTML5 contenteditable attribute not working properly on iOS7 Mobile Safari

查看:144
本文介绍了HTML5 contenteditable属性在iOS7 Mobile Safari上无法正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,满足的属性(在iOS6上运行良好)已停止在iOS7 webkit上运行。虽然浏览器似乎认为该字段是可编辑的,并且调出键盘,但任何输入似乎都会关闭它,或者它无法注册。有没有遇到同样的问题,或有任何解决方法?

It seems that the contenteditable attribute (which worked fine on iOS6) has stopped working on iOS7 webkit. Though the browser seems to recognize the field as editable, and brings up the keyboard, any input seems to close it, or it fails to register. Any encounter the same problem, or have any workarounds?

你可以试试这里 - http://html5demos.com/contenteditable

You can try it out over here - http://html5demos.com/contenteditable

谢谢!

推荐答案

我今天遇到了这个问题。我的解决方案是在CSS中为任何可编辑元素设置用户选择文字

I ran into this problem today. The solution for me was to set user-select to "text" in the CSS for any editable elements:

* {
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

这篇关于HTML5 contenteditable属性在iOS7 Mobile Safari上无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆