-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
The input box cannot continuously input or delete characters #16535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses an issue where users could not continuously input or delete characters in text areas by holding down keys. The fix removes the event.repeat check that was blocking key repeat events, and increases the debounce interval for Enter key handling to mitigate a related bug where holding Enter would create multiple notebooks.
Key changes:
- Removed
event.repeatcondition from the keydown event handler to allow continuous character input/deletion - Increased the debounce interval from 124ms to 200ms for Enter key handling to prevent duplicate submissions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (event.isComposing) { | ||
| event.preventDefault(); | ||
| return; |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the event.repeat check could have unintended consequences. While removing it allows continuous input/deletion by holding keys, it also removes protection against repeat events for special keys like Escape. The Escape key handler will now trigger repeatedly when held down, which could cause multiple rapid dialog destructions or race conditions. Consider handling event.repeat selectively - allow repeats for normal input but prevent them for action keys like Escape and Enter.
| if (timeStamp && event.timeStamp - timeStamp < 200) { | ||
| return; | ||
| } |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debounce interval change from 124ms to 200ms appears arbitrary and may not be sufficient to prevent double-submission issues. This value doesn't align with any standard debounce timing (e.g., 250ms, 300ms) and the choice of 200ms should be documented with a comment explaining why this specific duration was chosen. Additionally, consider whether this approach is robust enough - a timestamp-based debounce can still be bypassed by users who press Enter with deliberate timing.
|
3.5.1 |
长按键盘无法在 textarea 里连续输入文本或者删除文本,只能一个字母一个字母按,所以把 event.repeat 去掉。
之前连续按回车会重复创建笔记本的问题 #15150 仍然存在,把间隔时间改大了一点到 200ms。