简体   繁体   中英

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

Here is more info about it: 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.

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

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 . 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();
});

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