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

[Bug Report] 在安卓手机输入框的删除按钮点击没反应 #3555

Closed
LiangFuzhi opened this issue Jul 5, 2019 · 5 comments
Closed
Milestone

Comments

@LiangFuzhi
Copy link

VUX version

2.9.4

OS/Browsers version

安卓手机

Vue version

2.6.10

Code

在x-input.vue
onBlur ($event) {
      this.setTouched()
      this.validate()
      // this.isFocus = false
      this.$emit('on-blur', this.currentValue, $event)
    }
改为
onBlur ($event) {
      setTimeout(() => {
        this.setTouched()
        this.validate()
        this.isFocus = false
        this.$emit('on-blur', this.currentValue, $event)
      }, 0)
    }

focus () {
        this.$refs.input.focus()
    }
改为
focus () {
      setTimeout(() => {
        this.$refs.input.focus()
      }, 0)
    }
就能解决

Steps to reproduce

在安卓手机微信操作输入框,点击清空图标

What is Expected?

正常使用

What is actually happening?

点击清空没反应

@kevinchung1026
Copy link
Contributor

目前要自己修改下源码,已经有人提PR了

@LiangFuzhi
Copy link
Author

`<x-input class="input"
v-model="value"
ref="input"
@on-enter="search"
@on-focus="onFocus"
@on-blur="onBlur"
placeholder="请输入关键词">

onFocus () {
setTimeout(() => {
this.$refs.input.isFocus = true
}, 0)
},
onBlur () {
this.$refs.input.isFocus = true
setTimeout(() => {
this.$refs.input.isFocus = false
}, 0)
}`

不改源码的解决方案

@kevinchung1026
Copy link
Contributor

kevinchung1026 commented Jul 5, 2019

`<x-input class="input"
v-model="value"
ref="input"
@on-enter="search"
@on-focus="onFocus"
@on-blur="onBlur"
placeholder="请输入关键词">

onFocus () {
setTimeout(() => {
this.$refs.input.isFocus = true
}, 0)
},
onBlur () {
this.$refs.input.isFocus = true
setTimeout(() => {
this.$refs.input.isFocus = false
}, 0)
}`

不改源码的解决方案

多人协同开发时,这样更好。
不过,定时器最少16ms,即使你写的是0,所以改成20,可以好看点~🤣

@easy868
Copy link

easy868 commented Aug 5, 2019

问题+1

@caozhong1996 caozhong1996 added this to the 2.9.5 milestone Jun 18, 2021
@caozhong1996
Copy link
Collaborator

see #3778

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

No branches or pull requests

4 participants