fix: select tag value not correct #3100

pull/3128/head
tangjinzhou 2020-11-03 23:08:43 +08:00
parent 6a16e19b37
commit df1428e33d
1 changed files with 3 additions and 3 deletions

View File

@ -882,12 +882,12 @@ export default function generateSelector<
if (props.disabled) {
return;
}
if (mergedSearchValue.value) {
const serachVal = mergedSearchValue.value;
if (serachVal) {
// `tags` mode should move `searchValue` into values
if (props.mode === 'tags') {
triggerSearch('', false, false);
triggerChange(Array.from(new Set([...mergedRawValue.value, mergedSearchValue.value])));
triggerChange(Array.from(new Set([...mergedRawValue.value, serachVal])));
} else if (props.mode === 'multiple') {
// `multiple` mode only clean the search value but not trigger event
setInnerSearchValue('');