问题描述:Weex的input(https://weex.apache.org/zh/docs/components/input.html#%E7%AE%80%E4%BB%8B)标签,动态修改type时,由password改为text时失效,而在iOS平台上面是好的
问题所在:com.taobao.weex.ui.component.AbstractEditComponent
@WXComponentProp(name = Constants.Name.TYPE)
public void setType(String type) {
if (type == null || getHostView() == null) {
return;
}
mType = type;
//问题点
((EditText) getHostView()).setRawInputType(getInputType(mType));
switch (mType) {
case Constants.Value.DATE:
case Constants.Value.TIME:
applyOnClickListener();
break;
}
}
解决问题:com.taobao.weex.ui.component.AbstractEditComponent
@WXComponentProp(name = Constants.Name.TYPE)
public void setType(String type) {
if (type == null || getHostView() == null) {
return;
}
mType = type;
((EditText) getHostView()).setInputType(getInputType(mType));
switch (mType) {
case Constants.Value.DATE:
case Constants.Value.TIME:
applyOnClickListener();
break;
}
}
以上问题基于weex-sdk:version:0.18,不过,在最新的weex-sdk:version:0.28中也是存在这个问题
网友评论