salt-ui / saltui

MIT License
238 stars 64 forks source link

SelectField不做任何选择直接点击"取消"会出现再次进入选择面板直接点"完成"无效的情况 #411

Open KelWenGek opened 3 years ago

KelWenGek commented 3 years ago

请按照以下模板填写,不按照标准模板填写的 issue 将降低处理优先级。

这是一个

SaltUI 版本

4.10.6

浏览器、操作系统等环境信息

复现步骤

SelectField组件 初始value为null 点击弹出选择面板,不做任何操作,直接点击"取消"按钮 再点击弹出选择面板,直接点"完成"按钮,无法选中, 在Slot中的onCancel调用了 handleCancel() { const t = this; t.setState({ value: t.state.confirmedValue, }); } 导致t.lastChoose变成[null],然后 const confirmValue = isNotEmptyValue(t.lastChoose) ? t.lastChoose : t.setDefaultLastChoose(); 就判断lastChoose为非空, 如果此时只有一个选择项,就永远无法选择了

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.