Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Autocomplete menu closes when typing characters without accents for accented label or filterText

未关闭
#722 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript

调研方向

首先复现 issue 中描述的忽略重音符号的补全场景,然后跟踪输入前缀发生变化时 validFor 和 filterText 的求值方式。检查该行为应归属于这个 React wrapper,还是底层的 CodeMirror 补全处理。完成的标准是:对于 epossivel,菜单保持打开,并且仍然匹配所提供的 filterText。

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

描述

I'm using a custom completion source with filterText and label, and I want to support matches that are case-insensitive and accent-insensitive. For example, I have the following completion:

{
  label: '{ePossível}',
  filterText: 'epossivel',
  displayLabel: 'ePossível',
  type: 'string'
}

When I type:

  • epossível → ✅ matches
  • epossvel → ✅ matches
  • epossivel → ❌ the autocomplete menu disappears after typing the i

This happens even though filterText is set correctly. I suspect the issue lies in how validFor is used internally.


The completion menu should remain open as long as the text typed by the user matches the filterText or label, even if accent marks are missing or characters differ slightly (e.g. e vs é). In my case, epossivel should continue to match {ePossível} through filterText.


What I tried

  • I removed validFor → autocomplete doesn't appear at all.
  • I used validFor: /[\p{L}\p{N}_]+/u → still closes after typing i in epossivel.
  • I tried using a validFor function that normalizes both user input and filterText, but it seems the menu still disappears prematurely.

This issue only happens when trying to autocomplete accented labels from non-accented user input, which should match via filterText. It seems the internal logic closes the autocomplete menu when the input no longer matches the regex, even if the options still include a match after normalization.

Is there a recommended way to support accent-insensitive autocompletion?

主要语言
TypeScript
星标
2.3k
派生
162
平均合并
2 小时 41 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

uiwjs/react-codemirror 的其他 Issue

查看 uiwjs/react-codemirror 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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