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:
mo.duan 2019-09-06 15:05:06 +08:00
parent 8a93e8b53e
commit 6b285b78ed
4 changed files with 9 additions and 2 deletions

View file

@ -73,7 +73,7 @@
:parser="value => value.replace('%', '')"></InputNumber>
</div>
<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>
</template>

View file

@ -51,7 +51,7 @@
"lodash.throttle": "^4.1.1",
"popper.js": "^1.14.6",
"tinycolor2": "^1.4.1",
"v-click-outside-x": "^3.5.6"
"v-click-outside-x": "^4.0.19"
},
"peerDependencies": {
"vue": "^2.5.2"

View file

@ -14,6 +14,7 @@
auto-complete
:remote-method="remoteMethod"
@on-change="handleChange"
@on-clickoutside="handleClickOutside"
:transfer="transfer">
<slot name="input">
<i-input
@ -168,6 +169,11 @@
this.currentValue = '';
this.$refs.select.reset();
this.$emit('on-clear');
},
handleClickOutside(){
this.$nextTick(() => {
this.$refs.input.blur();
});
}
}
};

View file

@ -544,6 +544,7 @@
event.preventDefault();
this.hideMenu();
this.isFocused = true;
this.$emit('on-clickoutside', event);
} else {
this.caretPosition = -1;
this.isFocused = false;