-
Notifications
You must be signed in to change notification settings - Fork 546
Support Shift+Enter for newlines in the composer #40
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 25495
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 724
🌐 Web query:
MDN KeyboardEvent isComposing Enter compositionend IME browser behavior💡 Result:
The KeyboardEvent.isComposing property indicates whether a keyboard event is fired during an Input Method Editor (IME) composition session [1][2]. Ideally, this property should be true for the Enter key event used to commit an IME composition [3][4]. However, browser behavior regarding the Enter key and IME composition is inconsistent, specifically due to variations in event ordering [3][5]. In browsers like Chrome and Firefox, the Enter key event (keydown) is fired while isComposing is true, followed by the compositionend event [3]. This allows developers to reliably ignore or prevent the default action of the Enter key during composition [6][3]. In Safari, there is a long-standing, documented behavior where the compositionend event is dispatched before the final Enter keydown event [7][3]. Consequently, the Enter keydown event in Safari often arrives with isComposing set to false, because the composition session has already concluded [7][3]. This inconsistency can lead to accidental form submissions or other unwanted actions when users press Enter to finalize their IME input [7][3][4]. To handle these inconsistencies, developers are commonly advised to use the following strategies: - Check both event.isComposing and the deprecated event.keyCode === 229 (the special value for IME-processed events) [6][3][8]. - Implement a lock mechanism or a brief timeout (e.g., 50ms) after a compositionend event to "ignore" or suppress subsequent Enter key events that are actually part of the composition commit [3]. For robust cross-browser support, relying solely on isComposing is often insufficient due to this event-ordering discrepancy [7][3].
Citations:
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 6912
Handle IME Enter before mention-picker selection.
When
pickerOpenis true, the picker consumesEnterbefore the composition check. Guard composingEnterbefore the picker branch. Account for browsers where the final IMEEnterevent hasisComposing === false, and add regression coverage.🤖 Prompt for AI Agents