tody123 commented on issue #1519: Android端input控件在默认输入一个字符后,删除不能调用input回调 URL: https://github.com/apache/incubator-weex/issues/1519#issuecomment-420940812 发现只在默认只输入一个字符才会出现这个bug。应该原生的Edittext 在输入值setValue会触犯onTextChanged事件,weex在setValue时候通过mIgnoreNextOnInputEvent变量对这种情况进行了过滤从处理。原因是AbstractEditComponent.java文件中当删除一个字符时候会触犯onTextChanged事件, ` public void onTextChanged(CharSequence s, int start, int before, int count) { if (mIgnoreNextOnInputEvent) { mIgnoreNextOnInputEvent = false; return; } if (mBeforeText.equals(s.toString())) { return; } ` 当删除一个字符时候 ,这时候mBeforeText.equals(s.toString()) 成立都是空值,所以返回不触发事件。 可修改如: ` if (mIgnoreNextOnInputEvent) { mIgnoreNextOnInputEvent = false; mBeoreText = s.toString(); return; } ` 已提交pull request: https://github.com/apache/incubator-weex/pull/1522
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
