Skip to content

Bug fix: Malfunction of @keydown.enter when inputting Japanese on MacOS - #3419

Closed
196Ikuchil wants to merge 1 commit into
marktext:developfrom
196Ikuchil:fix_IME_problem_of_enterkey
Closed

196Ikuchil wants to merge 1 commit into
marktext:developfrom
196Ikuchil:fix_IME_problem_of_enterkey

Conversation

@196Ikuchil

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets Fixes #3418
License MIT

Description

When creating a new file or directory in the sidebar, typing Japanese causes @keydown.enter to malfunction.
In Japanese, there are two times to press the Enter key.

The first is when converting input to kanji.
The second is when completing input (when generating a file).
I would like @keydown.enter to be executed only the second time, but in fact, it is executed on the first press of Enter key and seems to be trying to generate a file without any text being entered. (And it fails to create the file because it has no filename entered.)

This problem should occur in languages other than Japanese where an IME is required, such as Chinese and Korean.
(Also this problem has occurred only on macOS.)

@196Ikuchil

Copy link
Copy Markdown
Author

Hello!
Thank you for the great markdown editor!
Please check this PR?

ping @fxha, @Jocs

Copilot AI left a comment

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.

Pull request overview

Fixes an IME-related sidebar input bug on macOS where pressing Enter during Japanese (and other IME) text conversion incorrectly triggers rename/create actions.

Changes:

  • Switched sidebar rename inputs from @keydown.enter to @keypress.enter in folder/file items.
  • Switched sidebar “new file/folder” inputs from @keydown.enter to @keypress.enter at both root tree and folder levels.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/renderer/components/sideBar/treeFolder.vue Uses @keypress.enter for folder rename and create input Enter handling.
src/renderer/components/sideBar/treeFile.vue Uses @keypress.enter for file rename Enter handling.
src/renderer/components/sideBar/tree.vue Uses @keypress.enter for root-level create input Enter handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 18 to 23
class="rename"
v-if="renameCache === folder.pathname"
v-model="newName"
ref="renameInput"
@keydown.enter="rename"
@keypress.enter="rename"
>
Comment on lines 36 to 41
type="text" v-if="createCache.dirname === folder.pathname"
class="new-input"
:style="{'margin-left': `${depth * 5 + 15}px` }"
ref="input"
@keydown.enter="handleInputEnter"
@keypress.enter="handleInputEnter"
v-model="createName"
Comment on lines 16 to 21
class="rename"
v-if="renameCache === file.pathname"
v-model="newName"
ref="renameInput"
@keydown.enter="rename"
@keypress.enter="rename"
>
ref="input"
v-model="createName"
@keydown.enter="handleInputEnter"
@keypress.enter="handleInputEnter"
@Jocs

Jocs commented May 15, 2026

Copy link
Copy Markdown
Member

This project recently merged a large refactor (electron-vite migration, PR #4001) that upgraded dependencies and fixed several issues.

Please review this PR and let us know if it is still needed, or if the changes have already been addressed upstream.

Note: This PR currently has merge conflicts with the develop branch. If you decide to continue with this PR, please rebase or merge the latest develop branch to resolve the conflicts before it can be reviewed.

@Jocs

Jocs commented May 20, 2026

Copy link
Copy Markdown
Member

Hi @196Ikuchil, thanks for opening this PR. We're going through old PRs and would like to confirm whether this one is still needed.

Since 2022 the project has gone through an electron-vite refactor (#4001), and the sidebar tree components are now under src/renderer/src/components/sideBar/. Could you check on the latest develop branch whether the issue (@keydown.enter firing while composing Japanese on macOS, in the file tree rename input) still reproduces?

If it does, please rebase against develop so we can review. If it no longer reproduces, or you no longer have the time to push this forward, we'll close it after a few weeks. Thank you either way.

@Jocs Jocs added the 🐤 blocked/need info Need more details about this issue or pull request label May 20, 2026
@Jocs Jocs closed this May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐤 blocked/need info Need more details about this issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Malfunction of @keydown.enter when inputting Japanese on MacOS

3 participants