fix: stop measure when the anchored prefix is removed - #339
Conversation
Removing the prefix char (e.g. the `@` just typed) used to re-anchor the measure to an earlier prefix in the text, keeping the dropdown open with wrong search text. Stop measuring instead, and skip the stale onSearch fire. Note: when text before the prefix shifts while measuring, the measure also stops now instead of re-anchoring to the shifted prefix.
|
@dogledogle is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough本次变更更新 Changes测量前缀处理
Priority: ⬇️ Low — Defer this mentions-input fix because it narrowly prevents a stale empty-results dropdown after deleting an @ prefix. Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The change stops mention measurement when its active prefix is deleted, preventing a stale empty-results dropdown from reopening. No merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 小兔挥爪改测量, Comment |
fix ant-design/ant-design#27426
问题
文本中已有一个
@时,再输入一个@打开候选框,随后按 Backspace 删除它,候选框会关闭后立刻重新出现在前一个@的位置,并显示 Not Found。原因
删除前缀符只更新了文本,测量状态未终止。随后的 keyup 会查找光标前最后一个
@(即文本中更早的旧@),而原有逻辑只要测量中就无条件重新测量,于是错误地锚到了旧@上。修复
测量进行中时校验原测量位置的前缀符是否还存在:
onSearch;测试
stop measure if remove prefix and previous prefix exists(未修复时失败,修复后通过);Summary by CodeRabbit
Bug Fixes
@前缀后,提及测量状态未正确停止的问题。@前缀。Tests