Skip to content
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

🐛[BUG] ProFormSelect 组件在选中匹配到的搜索项后,填充到输入框里的内容也带了高亮部分 #8918

Closed
DBvc opened this issue Dec 11, 2024 · 0 comments · Fixed by #8919

Comments

@DBvc
Copy link
Contributor

DBvc commented Dec 11, 2024

🐛 bug 描述

多选模式,开启labelInValue属性,在选中搜索匹配项目,填充到输入框的内容就包含了高亮的样式

Screenshot 2024-12-11 at 16 08 37

原因我已经找到了,我晚点提个 PR 看下

📷 复现步骤

下面的代码可以复现

启用 labelInValue,多选模式,就会出现上图的问题

import { ProFormSelect, ProForm } from '@ant-design/pro-components';
import { Select } from 'antd';
import React from 'react';

const selectOptions = [
  { label: '选项1', value: '1' },
  { label: '选项2', value: '2' },
  { label: '选项3', value: '3' },
  { label: '选项4', value: '4' },
]

export default () => {
  const [form] = ProForm.useForm();

  return (
    <ProForm form={form}>
      <ProFormSelect
        fieldProps={{
          mode: 'multiple',
          disabled: false,
          placeholder: '请选择',
          labelInValue: true,
          showSearch: true,
          optionFilterProp: 'label',
        }}
        options={selectOptions}
        name='support'
        label='负责人'
        rules={[{ required: true, message: '请选择负责人' }]}
      />
    </ProForm>
  );
};

🏞 期望结果

填充到输入框的内容不包含高亮的样式

💻 复现代码

© 版本信息

  • ProComponents 版本: 2.31.2
  • umi 版本
  • 浏览器环境
  • 开发环境 mac os

🚑 其他信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant