Skip to content

Commit cece733

Browse files
committed
fix: AutoComplete can not delete last character #1429
1 parent 59dc98d commit cece733

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/auto-complete/InputElement.jsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import PropTypes from '../_util/vue-types';
22
import { cloneElement } from '../_util/vnode';
3+
import { getOptionProps } from '../_util/props-util';
34
function chaining(...fns) {
45
return function(...args) {
56
// eslint-disable-line
@@ -12,6 +13,7 @@ function chaining(...fns) {
1213
};
1314
}
1415
export default {
16+
name: 'InputElement',
1517
props: {
1618
value: PropTypes.any,
1719
disabled: PropTypes.bool,
@@ -29,7 +31,8 @@ export default {
2931

3032
render() {
3133
const { $slots = {}, $listeners = {}, $props = {}, $attrs = {} } = this;
32-
const value = $props.value === undefined ? '' : $props.value;
34+
const props = getOptionProps(this);
35+
const value = props.value === undefined ? '' : props.value;
3336
const children = $slots.default[0];
3437
const { componentOptions = {} } = $slots.default[0];
3538
const { listeners = {} } = componentOptions;
@@ -43,7 +46,7 @@ export default {
4346
domProps: {
4447
value,
4548
},
46-
props: $props,
49+
props,
4750
on: newEvent,
4851
attrs: { ...$attrs, value },
4952
ref: 'ele',

components/vc-select/Select.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ const Select = {
304304

305305
onInputChange(e) {
306306
const { value: val, composing } = e.target;
307-
const { _inputValue = '' } = this;
307+
const { _inputValue = '' } = this.$data;
308308
if (composing || _inputValue === val) return;
309309
const { tokenSeparators } = this.$props;
310310
if (

0 commit comments

Comments
 (0)