fix bug of AutoComplete that can not blur when click outside
fix bug of AutoComplete that can not blur when click outside
This commit is contained in:
parent
8a93e8b53e
commit
6b285b78ed
4 changed files with 9 additions and 2 deletions
|
@ -73,7 +73,7 @@
|
||||||
:parser="value => value.replace('%', '')"></InputNumber>
|
:parser="value => value.replace('%', '')"></InputNumber>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<InputNumber v-model="value4" style="width: 200px" :precision='2' ></InputNumber>
|
<InputNumber :min="18" v-model="value4" style="width: 200px" :precision='2' ></InputNumber>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"popper.js": "^1.14.6",
|
"popper.js": "^1.14.6",
|
||||||
"tinycolor2": "^1.4.1",
|
"tinycolor2": "^1.4.1",
|
||||||
"v-click-outside-x": "^3.5.6"
|
"v-click-outside-x": "^4.0.19"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "^2.5.2"
|
"vue": "^2.5.2"
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
auto-complete
|
auto-complete
|
||||||
:remote-method="remoteMethod"
|
:remote-method="remoteMethod"
|
||||||
@on-change="handleChange"
|
@on-change="handleChange"
|
||||||
|
@on-clickoutside="handleClickOutside"
|
||||||
:transfer="transfer">
|
:transfer="transfer">
|
||||||
<slot name="input">
|
<slot name="input">
|
||||||
<i-input
|
<i-input
|
||||||
|
@ -168,6 +169,11 @@
|
||||||
this.currentValue = '';
|
this.currentValue = '';
|
||||||
this.$refs.select.reset();
|
this.$refs.select.reset();
|
||||||
this.$emit('on-clear');
|
this.$emit('on-clear');
|
||||||
|
},
|
||||||
|
handleClickOutside(){
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.input.blur();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -544,6 +544,7 @@
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.hideMenu();
|
this.hideMenu();
|
||||||
this.isFocused = true;
|
this.isFocused = true;
|
||||||
|
this.$emit('on-clickoutside', event);
|
||||||
} else {
|
} else {
|
||||||
this.caretPosition = -1;
|
this.caretPosition = -1;
|
||||||
this.isFocused = false;
|
this.isFocused = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue