简体   繁体   English

WebView选择导致软键盘暂时隐藏然后返回

[英]WebView selection causes soft keyboard to hide temporarily then come back

I have an application which contains a WebView. 我有一个包含WebView的应用程序。 Inside it is a div with contenteditable=true. 在里面它是一个具有contenteditable = true的div。

Suppose I have some text already in the div. 假设我已经在div中有一些文本。 When I first click on the text, the cursor pops up and so does the soft keyboard. 当我第一次点击文本时,光标会弹出,软键盘也会弹出。 The problem is that if I click again, the soft keyboard disappears and then reappears. 问题是如果我再次点击,软键盘会消失,然后重新出现。

Technically it isn't a problem since I can still write and do everything I need, but it is quite annoying to have the keyboard pop down and back up every time I want to click something. 从技术上讲,这不是问题,因为我仍然可以编写并执行我需要的所有操作,但每次我想点击某些内容时键盘弹出和备份都会非常烦人。

I think the problem is coming from the WebView getting a focus event every time I click inside it, but I am unsure if this is the case. 我认为问题来自WebView每次点击它时都会收到焦点事件,但我不确定是否是这种情况。

Can someone enlighten me as to what is happening, or at least point me to some resources that can help me? 有人可以告诉我发生了什么,或者至少指出一些可以帮助我的资源吗?

I tried it myself but there was the problem as you described. 我自己尝试过但是你所描述的问题就出现了。 I think you must have done something to override the tap function, so that it retrace the keyboard and again find that the focus is on editable content so it give keyboard again, That's the best I could think of 我认为你必须做一些事情来覆盖点击功能,以便它回溯键盘并再次发现焦点是可编辑的内容,所以它再次给键盘,这是我能想到的最好的

Hope This Helps 希望这可以帮助

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

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