Autocomplete menu closes when typing characters without accents for accented label or filterText
还没有人认领这个 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 typingiinepossivel. - I tried using a
validForfunction that normalizes both userinputandfilterText, 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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uiwjs/react-codemirror 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
uiwjs/react-codemirror#766 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
uiwjs/react-codemirror#765 ·
-
难度 3/5 1-2 天 新手友好度 35/100
uiwjs/react-codemirror#772 ·
-
难度 4/5 3-5 天 新手友好度 48/100
uiwjs/react-codemirror#770 ·
-
难度 3/5 1-2 天 新手友好度 48/100
uiwjs/react-codemirror#767 · 2 条评论 ·
查看 uiwjs/react-codemirror 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
chaitin/MonkeyCode#1437 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
carbon-design-system/carbon-ai-chat#2615 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offline可能已有人在做 @r2jaff 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ComposioHQ/composio#5054 ·
维护者通常 1 天内回复