屏幕键盘关闭的 Mobile Safari 事件是什么?
我想在 iPad Web 应用程序中关闭屏幕键盘时运行 $('html, body').animate({scrollTop: 0 }, 0);
。我尝试过使用 .blur();
但如果用户直接从屏幕键盘关注下一个或上一个字段,则会出现问题。
关闭键盘是否会触发任何类型的事件?这对我来说是最稳定的路线。
I'd like to run a $('html, body').animate({ scrollTop: 0 }, 0);
anytime the on-screen keyboard is closed in my iPad web app. I've tried with .blur();
but that causes problems if the user focuses on the next or previous field directly from the on-screen keyboard.
Does closing the keyboard trigger an event of any sort? That would be the most stable route for me to go.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将事件切换为blur(),它似乎在iPad上工作得更好,Playbook仍然做了一些奇怪的事情。我认为 Playbook 中的事件触发还没有完全实现。
Switched the event to blur() and it seems to work a lot better with the iPad, Playbook still does some strange things. I don't think the event firing is quite there for the Playbook yet.
我尝试检查脏输入,似乎选择器在键盘关闭后触发,所以我把你的代码放在那里,它的工作就像一个魅力:
这在 ipad 上工作,没有任何怪癖。在 Playbook 上,用户似乎必须选择“返回”按钮,然后关闭键盘才能正确触发更改功能。
I tried checking for dirty inputs and it seems the selector fires after the keyboard is closed, so I put your code in there and it worked like a charm:
This is working on ipad without any quirks. On the Playbook it looks like the user has to select the "return" button then close the keyboard for the change function to fire correctly.