Skip to content

Bug: ElementPlus's integration VbenApiSelect behaves abnormally in the form after the filtering function is enabled #5132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
5 tasks done
han2-n opened this issue Dec 13, 2024 · 4 comments

Comments

@han2-n
Copy link

han2-n commented Dec 13, 2024

Version

Vben Admin V5

Describe the bug?

When using a VbenApiSelect with the filter function enabled in a form, each time you type text to filter, the select value automatically changes to the current search text.

Similar issues: #5090

Reproduction

NA

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
    Memory: 14.05 GB / 31.78 GB
  Binaries:
    Node: 20.11.1 - ~\scoop\apps\nodejs-lts\current\node.EXE
    Yarn: 1.22.19 - ~\scoop\apps\yarn\current\bin\yarn.CMD
    npm: 10.2.4 - ~\scoop\apps\nodejs-lts\current\npm.CMD
    pnpm: 9.15.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355

Relevant log output

No response

Validations

@mynetfan
Copy link
Collaborator

#5127

@mynetfan
Copy link
Collaborator

mynetfan commented Dec 13, 2024

Set form options disabledOnInputListener to value true.
The vee-validate will bind onInput on all sub components but conflicts with the filtering function of the Select/SelectV2... in ElementPlus

@han2-n
Copy link
Author

han2-n commented Dec 13, 2024

Set form options disabledOnInputListener to value true. The vee-validate will bind onInput on all sub components but conflicts with the filtering function of the Select/SelectV2... in ElementPlus

I set disabledOnInputListener to true, and it only works with Select/SelectV2.
If I use ApiSelect, it doesn't work properly.

@mynetfan
Copy link
Collaborator

mynetfan commented Dec 14, 2024

    {
      component: 'ApiSelect',
      componentProps: {
        afterFetch: (data: { name: string; path: string }[]) => {
          return data.map((item: any) => ({
            label: item.name,
            value: item.path,
          }));
        },
        api: getAllMenusApi,
        filterable: true
      },
      fieldName: 'api',
      label: 'ApiSelect',
      // You need below 2 lines to fix Element plus ApiSelect
      disabledOnChangeListener: true,
      disabledOnInputListener: true,
    },

@han2-n han2-n closed this as completed Dec 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants