diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index fd44372e9..fd840284a 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -1,46 +1,53 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./antdv-demo/docs/select/demo/automatic-tokenization.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/basic.md correctly 1`] = `
-
-
+ +
+ +
-
-
+ +
+ +
-
-
+ +
+ +
@@ -48,230 +55,248 @@ exports[`renders ./antdv-demo/docs/select/demo/basic.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/select/demo/coordinate.md correctly 1`] = `
-
-
+ +
+ +
-
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/custom-dropdown-menu.md correctly 1`] = ` -
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/hide-selected.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/label-in-value.md correctly 1`] = ` -
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/multiple.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/optgroup.md correctly 1`] = ` -
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/option-label-prop.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/options.md correctly 1`] = ` -
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/search.md correctly 1`] = ` -
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/search-box.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/select-users.md correctly 1`] = ` -
-
+ +
+
`; exports[`renders ./antdv-demo/docs/select/demo/size.md correctly 1`] = `
-


-
-
+


+ +
+ -

-
-
-
- -
- - - -
+ +
a1
+
-

-
-
+

+ +
+ +

+ +
+
@@ -279,34 +304,43 @@ exports[`renders ./antdv-demo/docs/select/demo/size.md correctly 1`] = ` exports[`renders ./antdv-demo/docs/select/demo/suffix.md correctly 1`] = `
-
-
+ +
+ +
-
-
+ +
+ +
`; exports[`renders ./antdv-demo/docs/select/demo/tags.md correctly 1`] = ` -
-
+ +
+
`; diff --git a/components/vc-select/Select.jsx b/components/vc-select/Select.jsx index 475190e4a..53b561fb8 100644 --- a/components/vc-select/Select.jsx +++ b/components/vc-select/Select.jsx @@ -47,6 +47,7 @@ import { import { SelectPropTypes } from './PropTypes'; import contains from '../vc-util/Dom/contains'; import { isIE, isEdge } from '../_util/env'; +import isValid from '../_util/isValid'; const SELECT_EMPTY_VALUE_KEY = 'RC_SELECT_EMPTY_VALUE_KEY'; @@ -637,7 +638,7 @@ const Select = { if (value.length) { hidden = true; } - if (isCombobox(props) && value.length === 1 && state._value && !state._value[0]) { + if (value.length === 1 && state._value && !isValid(state._value[0])) { hidden = false; } const placeholder = props.placeholder; diff --git a/examples/App.vue b/examples/App.vue index 1157c87ad..d0e397178 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -4,7 +4,7 @@