Skip to content

AutoComplete 回车bug #7971

@clddup

Description

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

Version

4.2.6

Environment

chrome 131.0.6778.109, vue ^3.4.29

Reproduction link

https://github.com/clddup/antdv-auto-complete-bug

Steps to reproduce

  1. 输入框输入文本后,出现提示文本列表
  2. 通过键盘向下选择第二个或第三个, 回车,此时,输入框内值被更新
  3. 这个时候为了防止下次输入框获取焦点还出现提示文本列表, 我会清空文本列表
  4. 再次点击回车想进行我的搜索事件,请求远端api(为了简化实例, 没有写这个步骤)
  5. 此时输入框的值会被自动更新为 文本提示列表的第一项, 但是我上面第三步已经清空了提示列表

What is expected?

期望我回车时候 不修改我的值改为之前提示列表第一项, 因为这时候我的提示列表是空的

What is actually happening?

我的输入框值被改为了之前 提示列表第一项

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions