【发布时间】:2020-04-09 08:33:46
【问题描述】:
我有一个具有 iframe 的 ionic v1 应用程序。我尝试在输入字段中写入,没关系。但是当我再次点击输入时,我不能再写了。这仅在 IOS 中发生;对于 Android 上的任何 iframe,只要有一个输入字段,它就可以完美运行。
我尝试通过window.addEventListener 处理焦点和触摸事件,但它仍然不起作用。我还尝试上下触发键盘。如果你能帮助我,我将有很多周处理这件事,我将不胜感激。在这个链接中我留下了一些证据Video Evidence
window.addEventListener('blur', function() {
focusElement();
});
window.addEventListener('native.keyboardshow', focusElement);
function focusElement() {
$timeout(function() {
var iframe = document.getElementById('ofertasExclusivasIframe');
iframe.contentWindow.focus();
console.log("----------loaded---------", iframe)
}, 250);
}
$scope.$on('$destroy', handleDestroy);
function handleDestroy() {
$window.removeEventListener('native.keyboardshow', focusElement);
}
【问题讨论】:
标签: javascript ios ionic-framework iframe webview