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

AutoComplete 自动完成-自定义选项 为什么设计成选择完选项回填到输入框时,自动前后加空格? #3608

Open
1 task
pl2476 opened this issue Jan 28, 2021 · 3 comments
Assignees

Comments

@pl2476
Copy link

pl2476 commented Jan 28, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.2

Environment

browser version:87.0.4280.141

Reproduction link

https://antdv.com/components/auto-complete-cn/

Steps to reproduce

直接在文档网站即可操作出来
1、选择AutoComplete代码演示
2、查看自定义选项例子
3、输入1
4、选择下拉”1@gmail.com
5、得出输入框结果” 1@gmail.com

What is expected?

1@gmail.com

What is actually happening?

1@gmail.com


这样的话,如果用户想删除某些字符,得先删除一些空格,操作不太友好

@zkwolf zkwolf self-assigned this Jan 28, 2021
@zkwolf
Copy link
Member

zkwolf commented Jan 29, 2021

  <a-auto-complete
    style="width: 200px"
    placeholder="input here"
    option-label-prop="title"
  >
    <template slot="dataSource">
      <a-select-option v-for="email in result" :key="email" :title="email">
        {{ email }}
      </a-select-option>
    </template>
  </a-auto-complete>
</template>

这样规避一下吧

@pl2476
Copy link
Author

pl2476 commented Feb 6, 2021

谢谢 之前暂时这么处理了

@cooper1x
Copy link

cooper1x commented Jun 4, 2024

  <a-auto-complete
    style="width: 200px"
    placeholder="input here"
    option-label-prop="title"
  >
    <template slot="dataSource">
      <a-select-option v-for="email in result" :key="email" :title="email">
        {{ email }}
      </a-select-option>
    </template>
  </a-auto-complete>
</template>

这样规避一下吧

试过了没有用,1.7.8 的版本,想请教下为什么这个要加 title,而不是 label 呢,label 也试过了不行。

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

No branches or pull requests

4 participants