Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-input被键盘遮挡 #2604

Closed
xiaolei335 opened this issue Apr 7, 2018 · 11 comments
Closed

x-input被键盘遮挡 #2604

xiaolei335 opened this issue Apr 7, 2018 · 11 comments

Comments

@xiaolei335
Copy link

如果x-input靠近页面下方的话,输入的时候弹出手机软键盘,会将x-input遮挡住。

在官方的Demo里,这个问题同样存在
https://vux.li/demos/v2/?x-page=v2-doc-home#/component/x-input

@airyland
Copy link
Owner

airyland commented Apr 7, 2018

请说明重现环境谢谢。

@xiaolei335
Copy link
Author

你好,在android手机上会出现这种情况,ios是正常的。

在魅族pro6 plus手机上,在自带浏览器或微信里打开页面
https://vux.li/demos/v2/?x-page=v2-doc-home#/component/x-input

点击靠页面下方的input,系统软键盘弹出,input会被遮挡

@xiaolei335
Copy link
Author

xiaolei335 commented Apr 7, 2018

目前我的解决办法是在App.vue里加入了一段代码解决,但是比较尴尬,不完美

window.addEventListener("resize", function () {
  if (document.activeElement.tagName == "INPUT" || document.activeElement.tagName == "TEXTAREA") {
    window.setTimeout(function () { 
      document.activeElement.scrollIntoViewIfNeeded();
    },0);
  }
})

@airyland
Copy link
Owner

airyland commented Apr 7, 2018

尴尬之处是什么,是说功能能实现,但是这样全局处理不和谐?

@xiaolei335
Copy link
Author

xiaolei335 commented Apr 7, 2018

对的,这个应该是vux框架自带就应该解决的,目前键盘遮挡的情况在android手机上非常普遍,大家应该都存在这种问题,比较影响用户体验

@xiaoningtongxue
Copy link

@airyland 加了给出的那段代码,在iphone7-ios11.12下依然不能解决问题。

@againForget
Copy link

这个问题有解决办法了么

@Jiiiiiin
Copy link

这是webview 和android应用层面应该解决的问题

@Newgar
Copy link

Newgar commented Jul 27, 2018

我的也有这种情况点击input框 弹出键盘后 input框就被顶到上面去了,页面也给我翻到了最下面 然后还有一个 从input框失去焦点的时候,如果点击的部位有group 那么 也会翻页到最下面~~~.
安卓手机 都这样
苹果没试

@easy868
Copy link

easy868 commented Sep 8, 2018

iphone x 键盘刚弹起后是正常,不到一秒钟输入框就会下移,被键盘遮挡

@Vera6
Copy link

Vera6 commented Dec 24, 2019

iphone 系统为13的,键盘弹起时,光标不能自动focus,会错位。APP用的是uiwebview,而且滚动也滚动不到最底部。输入框一点光标就错位。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants