Skip to content

Commit

Permalink
chore: complete params
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Dec 28, 2024
1 parent f735eb7 commit 1a901b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,14 @@ export default defineComponent({
.slice(0, max.value || Infinity),
{ e, trigger: isAllOptionsChecked.value ? 'uncheck' : 'check' },
);
!reserveKeyword?.value && setTInputValue('');
!reserveKeyword?.value && setTInputValue('', { e, trigger: 'change' });
};

const handleCreate = () => {
const handleCreate = (e) => {

Check failure on line 352 in src/select/select.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / build

Parameter 'e' implicitly has an 'any' type.

Check failure on line 352 in src/select/select.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / build

Parameter 'e' implicitly has an 'any' type.

Check failure on line 352 in src/select/select.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / test

Parameter 'e' implicitly has an 'any' type.
if (!tInputValue.value) return;
const createVal = tInputValue.value;
// 只有多选情况下需要帮用户清除一次输入框内容,单选场景选中后 popup 消失,携带内容清除的作用
multiple.value && setTInputValue('');
multiple.value && setTInputValue('', { e, trigger: 'change' });
instance.emit('create', createVal);
props.onCreate?.(createVal);
};
Expand Down Expand Up @@ -529,7 +529,7 @@ export default defineComponent({
case 'Enter':
// 当支持创建、且 hoverIndex 为 -1(未选中)/0(创建条目)、第一项为创建项的时候,才视为触发 create 回调,并继续键盘事件
if (creatable.value && hoverIndex.value < 1 && displayOptions?.[0]?.isCreated) {
handleCreate();
handleCreate(e);
} else if (hoverIndex.value === -1) {
// 否则视为选择列表中筛选出的已有项目
// 当 hoverIndex 为 -1,即未选中任意项的时候,不触发其他键盘事件
Expand All @@ -554,7 +554,7 @@ export default defineComponent({
case 'Escape':
case 'Tab':
setInnerPopupVisible(false, { trigger: 'keydown-esc', e });
setTInputValue('');
setTInputValue('', { e, trigger: 'blur' });
break;
}
};
Expand All @@ -576,7 +576,7 @@ export default defineComponent({
// 显示 popup 的时候重置 hover 选项下标
hoverIndex.value = -1;
} else {
tInputValue.value && setTInputValue('');
tInputValue.value && setTInputValue('', { trigger: 'blur' });
}
});
provide('tSelect', {
Expand Down

0 comments on commit 1a901b7

Please sign in to comment.