Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/channels/web/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,10 @@ chatInput.addEventListener('keydown', (e) => {
}
}

if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) {
// Safari fires compositionend before keydown, so e.isComposing is already false
// when Enter confirms IME input. keyCode 229 (VK_PROCESS) catches this case.
// See https://bugs.webkit.org/show_bug.cgi?id=165004
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing && e.keyCode !== 229) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and maintainability, consider extracting the magic number 229 into a named constant like const VK_PROCESS = 229;. This could be defined at a suitable scope (e.g., at the top of the file). The comment already helpfully mentions VK_PROCESS, and using a constant would make the code even clearer.

e.preventDefault();
hideSlashAutocomplete();
sendMessage();
Expand Down
Loading