KeyboardShrinksView使失去焦点 [英] KeyboardShrinksView makes lose focus

查看:474
本文介绍了KeyboardShrinksView使失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Phonegap 2.6(ios)中包含的KeyboardShrinksView功能有一个问题。

I have a problem with the KeyboardShrinksView feature that is included in Phonegap 2.6 (ios).

当我点击textarea中要包含文本时,键盘出现,网页视图按照我的意愿收缩。

When I tap in the textarea where I want to include text, the keyboard appears and the webview is contracted as I wanted.

问题是我失去了对文本区域的焦点,用户必须再次点击文本区域开始

The problem is that I lose the focus on the textarea and the user has to tap again in the text area to start writing in it.

任何人都有与此新功能相同的问题吗?

Is anyone having the same problem with this new feature?

谢谢!

推荐答案

element.on("tap", function(e){element.focus()});

问题来自于使用ghost点击事件集中在ios上。

The issue comes from the fact that focus is done on ios using the ghost click event. But the view has already changed (because of the keyboard) when it's fired.

这个问题在ios7会更常见,因为KeyboardShrinksView是默认行为...

This problem will be even more common on ios7 since KeyboardShrinksView is the default behavior...

这篇关于KeyboardShrinksView使失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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