|
1 | | -import { TransitionGroup } from 'vue'; |
| 1 | +import { TransitionGroup, withDirectives } from 'vue'; |
2 | 2 | import KeyCode from '../_util/KeyCode'; |
3 | 3 | import PropTypes from '../_util/vue-types'; |
4 | 4 | import classnames from '../_util/classNames'; |
@@ -49,6 +49,7 @@ import contains from '../vc-util/Dom/contains'; |
49 | 49 | import { isIE, isEdge } from '../_util/env'; |
50 | 50 | import isValid from '../_util/isValid'; |
51 | 51 | import { getDataAndAriaProps } from '../_util/util'; |
| 52 | +import antInput from '../_util/antInputDirective'; |
52 | 53 |
|
53 | 54 | const SELECT_EMPTY_VALUE_KEY = 'RC_SELECT_EMPTY_VALUE_KEY'; |
54 | 55 |
|
@@ -639,7 +640,7 @@ const Select = { |
639 | 640 | if (value.length) { |
640 | 641 | hidden = true; |
641 | 642 | } |
642 | | - if (value.length === 1 && state._value && !isValid(state._value[0])) { |
| 643 | + if (isCombobox(props) && value.length === 1 && state._value && !isValid(state._value[0])) { |
643 | 644 | hidden = false; |
644 | 645 | } |
645 | 646 | const placeholder = props.placeholder; |
@@ -781,18 +782,13 @@ const Select = { |
781 | 782 | // Add space to the end of the inputValue as the width measurement tolerance |
782 | 783 | return ( |
783 | 784 | <div class={`${props.prefixCls}-search__field__wrap`} onClick={this.inputClick}> |
784 | | - {cloneElement(inputElement, { |
| 785 | + {cloneElement(withDirectives(inputElement, [[antInput]]), { |
785 | 786 | disabled: props.disabled, |
786 | 787 | ...(inputElement.props || {}), |
787 | 788 | disabled: props.disabled, |
788 | 789 | value: inputValue, |
789 | 790 | class: inputCls, |
790 | 791 | ref: this.saveInputRef, |
791 | | - // directives: [ |
792 | | - // { |
793 | | - // name: 'ant-input', |
794 | | - // }, |
795 | | - // ], |
796 | 792 | onInput: this.onInputChange, |
797 | 793 | onKeydown: chaining( |
798 | 794 | this.onInputKeydown, |
|
0 commit comments