diff --git a/packages/fighting-design/option/src/option.vue b/packages/fighting-design/option/src/option.vue index a496717b2..1ddc84a5d 100644 --- a/packages/fighting-design/option/src/option.vue +++ b/packages/fighting-design/option/src/option.vue @@ -21,7 +21,7 @@ const parentInject: SelectProvide | null = inject(SELECT_PROPS_TOKEN, null) /** 获取到 trigger 注入的依赖项 */ const triggerInject: TriggerProvide | null = inject(TRIGGER_CLOSE_KEY, null) - + /** 获取插槽内容 */ const slotLabel = computed((): string => { if (!slot.default) { @@ -46,10 +46,17 @@ if (!parentInject) { return false } + + // Trigger 展示状态高优先级 + if (!triggerInject?.isVisible()) { + return false + } // 在过滤属性存在并且是正在输入中,执行过滤操作 - if (parentInject.filter && parentInject.isFiltering && currentLabel) { - return currentLabel.toString().includes(parentInject.inputValue) + if (parentInject.filter || parentInject.isFiltering) { + return currentLabel + ? currentLabel.toString().includes(parentInject.inputValue) + : false } return true diff --git a/packages/fighting-design/select/src/select.vue b/packages/fighting-design/select/src/select.vue index 0faf3512a..f56fd078a 100644 --- a/packages/fighting-design/select/src/select.vue +++ b/packages/fighting-design/select/src/select.vue @@ -121,8 +121,8 @@ inputValue, isFiltering, onBeforeChange: prop.onBeforeChange, - modelValue: toRef(prop, 'modelValue'), - filter: toRef(prop, 'filter') + modelValue, + filter: prop.filter }) )