github / github/auto-complete-element

Dropdown does not close on all blur events

未关闭
#136 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
407
派生
57
平均合并
1 天 7 小时
30 天内合并 PR
5

描述

We recently moved our application to this library from twitter-typeahead and have run into an issue where the results dropdown will only close when a selection is made. If a user clicks away from the input or tabs to the next form item the dropdown remains open.

This is inconvenient when a value for the field is already set and does not need to be changed. The user accidentally clicks the input or is tabbing through the page and the dropdown opens from the focus event, visually blocking the next form fields until the user makes the selection again.

Is this dropdown behavior intended? If so, could a prop be added so that implementers can turn it on or off?

If it isn't intended behavior, I think changing [this line](https://github.com/github/auto-complete-element/blob/main/src/autocomplete.ts#L250) to `this.interactingWithList = false` or possibly just removing that line altogether would fix things.

贡献指南

打开贡献指南

调研方向

Start at src/autocomplete.ts line 250 and trace how blur, focus, and list interaction state control the dropdown. Confirm the intended behavior for clicking away and tabbing, then verify that the dropdown closes in both cases without breaking selection behavior.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。