gpt4 book ai didi

javascript - iPad 上 iframe 中的文本区域行为

转载 作者:行者123 更新时间:2023-11-29 02:17:41 25 4
gpt4 key购买 nike

如果将 textarea 和 input 放在 iframe 中,它们将无法在 iPad Safari 上正常工作,这是已知错误

这里是关于它的更多信息:https://bugs.webkit.org/show_bug.cgi?id=133044

实际上它适用于 iOS 8,但在 iOS 7 上这个错误很容易重现。

但尽管如此 - 我需要为此找到一些可行的解决方案。

我尝试在父级上添加 touchstart 事件处理程序(它是如何建议的),与 mouseuptouchmove 事件相同 - 没有任何效果

也许有人知道任何可行的解决方案?

谢谢

最佳答案

我已经遇到这个问题好几天了,通过谷歌搜索大部分互联网也遇到了这个问题。但是没有一个帖子包含答案。这是对我有用的解决方案。它基于 https://gist.github.com/tamarasaurus/dcf2d0331043586421f3 .希望这会在未来帮助人们,或者至少为他们指明正确的方向。

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

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

关于javascript - iPad 上 iframe 中的文本区域行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28564868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com