element-plus / element-plus

🎉 A Vue.js 3 UI Library made by Element team
https://element-plus.org
MIT License
24.56k stars 16.62k forks source link

[Component] [select] In the select component, when the filterable attribute is set, if the data source is too large, the filtering results are incorrect. #18133

Open xzhdev opened 2 months ago

xzhdev commented 2 months ago

Bug Type: Component

Environment

Reproduction

Related Component

Reproduction Link

CodeSandbox

Steps to reproduce

For example, in the el-select component, when you input "A" there is no such option in the data source, but there is still a result displayed. I tested this in both the el-select-v2 of Element Plus and the select component of Element UI, and there was no issue.

What is Expected?

Correct filtering results

What is actually happening?

Incorrect filtering results

Additional comments

(empty)

xzhdev commented 2 months ago

image Compare

github-actions[bot] commented 2 months ago

Hello @xzhdev. Please provide an online reproduction demo by clicking this link or a minimal GitHub repository. Issues marked with need reproduction will be closed if they have no activity within 3 days.

你好 @xzhdev, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。可以通过点击 此处 创建或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

xzhdev commented 2 months ago

@btea Here's the address. See if you can preview it. https://codesandbox.io/p/sandbox/element-plus-spa-forked-wd53y7

btea commented 2 months ago

I tried it and it seems that the options you provided are duplicated, which caused the query error. After removing the duplicates, the performance is normal.

xzhdev commented 2 months ago

Duplicates? Can you show me the duplicates labeled, I'll check them once

btea commented 2 months ago

The following is my local filtering code, you can refer to it.

image

xzhdev commented 2 months ago

Thanks

xzhdev commented 2 months ago

@btea My suggestion is that even if the value has duplicates, it should not affect the filterable feature. The options should still be filterable, and it would be better if the behavior is consistent with select-v2 when using the filterable property.