feat: input add focus when click clear button

pull/1311/head
tanjinzhou 2019-10-17 19:26:58 +08:00
parent 8820a184e2
commit 723b6c6cf6
1 changed files with 10 additions and 1 deletions

View File

@ -114,6 +114,9 @@ export default {
handleReset(e) {
this.setValue('', e);
this.$nextTick(() => {
this.focus();
});
},
handleChange(e) {
@ -123,7 +126,13 @@ export default {
renderClearIcon(prefixCls) {
const { allowClear, disabled } = this.$props;
const { stateValue } = this;
if (!allowClear || disabled || stateValue === undefined || stateValue === null || stateValue === '') {
if (
!allowClear ||
disabled ||
stateValue === undefined ||
stateValue === null ||
stateValue === ''
) {
return null;
}
return (