Skip to content

Commit c69ecb8

Browse files
committed
Revert "Added checks for the isComposing property of the KeyboardEvent object before handling Enter key events. When isComposing is true, it means the user is in the middle of converting characters with an Input Method Editor, and we should not interfere with the input."
This reverts commit 34e7297.
1 parent a9165db commit c69ecb8

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

apps/desktop/src/components/CommitMessageEditor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
emitAction();
173173
}
174174
}
175-
if ((e.key === 'Enter' || (e.key === 'Tab' && !e.shiftKey)) && !e.isComposing) {
175+
if (e.key === 'Enter' || (e.key === 'Tab' && !e.shiftKey)) {
176176
e.preventDefault();
177177
composer?.focus();
178178
}

apps/desktop/src/components/Feed.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
function handleKeyDown(event: KeyboardEvent | null): boolean {
5858
if (event === null) return false;
5959
60-
if (event.key === 'Enter' && !event.shiftKey && !event.isComposing) {
60+
if (event.key === 'Enter' && !event.shiftKey) {
6161
event.preventDefault();
6262
event.stopPropagation();
6363
sendCommand();

apps/desktop/src/components/IrcInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
bind:value={input}
3232
wide
3333
onkeydown={(e) => {
34-
if (e.key === 'Enter' && !e.isComposing) onclick();
34+
if (e.key === 'Enter') onclick();
3535
}}
3636
/>
3737
<Button type="button" size="button" style="pop" {onclick}>send</Button>

apps/desktop/src/components/ReviewCreation.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
prTitle.set(value);
380380
}}
381381
onkeydown={(e: KeyboardEvent) => {
382-
if ((e.key === 'Enter' || (e.key === 'Tab' && !e.shiftKey)) && !e.isComposing) {
382+
if (e.key === 'Enter' || (e.key === 'Tab' && !e.shiftKey)) {
383383
e.preventDefault();
384384
messageEditor?.focus();
385385
}

apps/desktop/src/components/editor/MessageEditor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@
413413
rulerCountValue.set(parseInt(input.value));
414414
}}
415415
onkeydown={(e) => {
416-
if (e.key === 'Enter' && !e.isComposing) {
416+
if (e.key === 'Enter') {
417417
e.preventDefault();
418418
composer?.focus();
419419
}

apps/web/src/lib/components/chat/ChatInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
121121
const metaKey = event.metaKey || event.ctrlKey;
122122
123-
if (event.key === 'Enter' && !event.shiftKey && !event.isComposing && suggestions.suggestions === undefined) {
123+
if (event.key === 'Enter' && !event.shiftKey && suggestions.suggestions === undefined) {
124124
event.preventDefault();
125125
event.stopPropagation();
126126
handleSendMessage();

packages/ui/src/lib/richText/plugins/EmojiSuggestions.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
}
7575
7676
function onEnter(event: KeyboardEvent): boolean {
77-
if (suggestedEmojis === undefined || selectedSuggestionIndex === undefined || event.isComposing) return false;
77+
if (suggestedEmojis === undefined || selectedSuggestionIndex === undefined) return false;
7878
7979
selectSuggestion(suggestedEmojis[selectedSuggestionIndex]);
8080
event.preventDefault();

packages/ui/src/lib/richText/plugins/GiphyPlugin.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
} else {
4949
if (key.length === 1 && key.match(/\w/)) {
5050
queryBuffer += key;
51-
} else if (key === 'Enter' && !e.isComposing) {
51+
} else if (key === 'Enter') {
5252
query = queryBuffer;
5353
position = getCursorPosition();
5454
e.preventDefault();

0 commit comments

Comments
 (0)