didi / mand-mobile

💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.

Home Page:https://didi.github.io/mand-mobile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug-report] textarea-item 监听input事件$_onInput中文输入法中过度导致change事件

gy1001 opened this issue · comments

Mand Mobile Version

2.5.11

Vue Version

2.6.11

Model / OS & Browser Info

ipone

Node Version, Package Management Tool

node 14.16.1/ npm 8.0.0

Recurring Steps

  1. 输入中文、英文、数字等
  2. 英文输入法和数字输入法时候没有问题
  3. 中文输入法时候还没有选择中文字符时候就会触发 change input 事件

Expectant Behaviors

  1. 英文输入法依旧
  2. 中文输入法确认字符后触发change input事件

Actual Behaviors

  1. 英文数字正常
  2. 中文输入法开始输入就触发 change input 事件
    如图

{{ textValue.length }} [输入框输入中文未确认输入字符时候也会触发change事件,同事textValue也会变化] 看源码 textarea身上绑定事件 @input="$_onInput" ,在$_onInput中直接 this.inputValue = event.target.value ;导致inputValue 变化,触发watch 中的逻辑调用 this.$emit('input', val); 是否可以在$_onInpu 后面应该可以做一些判断处理,符合条件的进行现有逻辑处理,否则不处理的