pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] ProTable columns中配置valueType:'select' +request时,搜索完选中值后会触发一次新的搜索

Open Chryseis opened this issue 4 months ago • 0 comments

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

在ProTable columns中配置了一个远程下拉搜索框

 {
      title: '测试',
      dataIndex: 'test',
      hideInTable: true,
      valueType: 'select',
      request: async params => {
        console.log(params)
        const result = await fetchData({ name: params.keyWords || '' })

        return result?.map(({ id: value, name: label }) => {
          return { label, value }
        })
      },
      defaultKeyWords: '',
      fieldProps: {
        showSearch: true,
        placeholder: '请输入',
      },
    },

📷 复现步骤

  1. 输入框搜索内容
  2. 选中一个值

🏞 期望结果

选中值后不触发请求

💻 复现代码

https://codesandbox.io/p/sandbox/qgnx8z

© 版本信息

  • ProComponents 版本:2.6.42
  • umi 版本 未使用
  • 浏览器环境 Chrome 129
  • 开发环境 macOS

🚑 其他信息

Chryseis avatar Oct 09 '24 16:10 Chryseis