简体   繁体   English

iPad上iframe中的Textarea行为

[英]Textarea behaviour in iframes on iPad

It is know bug about that fact that textarea and inputs do not work properly on iPad Safari if they are placed inside iframe 关于文本区域和输入(如果将它们放置在iframe中的话)在iPad Safari上无法正常工作这一事实是已知的错误

Here is more info about it: https://bugs.webkit.org/show_bug.cgi?id=133044 这是有关它的更多信息: https : //bugs.webkit.org/show_bug.cgi?id=133044

Actually it work on iOS 8, but on iOS 7 this bug is easy to reproduce. 实际上,它可以在iOS 8上运行,但在iOS 7上,此错误很容易重现。

But despite of this - I need to find some working solution for this. 但是尽管如此-我需要为此找到一些可行的解决方案。

I tried to add touchstart event handlers on parent (how it advised), same to mouseup , touchmove events - nothing works 我试图在父级上添加touchstart事件处理程序(如何建议),与mouseuptouchmove事件相同-没有任何作用

Maybe somebody knows any working solution for this? 也许有人知道任何可行的解决方案?

Thanks 谢谢

I've had this problem for days and from googling around most of the internet has too. 我遇到这个问题已经有好几天了,而在大多数互联网上也都使用谷歌搜索。 But none of the posts contained an answer. 但是这些帖子都没有答案。 This is the solution that worked for me. 这是对我有用的解决方案。 It's based on https://gist.github.com/tamarasaurus/dcf2d0331043586421f3 . 它基于https://gist.github.com/tamarasaurus/dcf2d0331043586421f3 Hopefully this will help people in the future, or at least point them in the right direction. 希望这将对将来的人们有所帮助,或者至少为他们指明正确的方向。

document.addEventListener('keydown', function(e) {
    window.focus();
});

document.addEventListener('touchend', function(e) {
    window.focus();
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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