Repository navigation
Description
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.
- First is when converting input to kanji.
- 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.)
At least using @keypress.enter instead avoids this problem.
I think this is the better way to fix this. quickly without effect some logic.
- Can you reproduce the issue?
Expected behavior:
Event @keydown.enter run only when the enter key is pressed a second time (decision input).
Actual behavior:
Event @keydown.enter run at the first time(converting input)
Link to an example: [optional]
For example, these codes occur the bug of this issue.
| @keydown.enter="handleInputEnter" |
| @keydown.enter="rename" |
| @keydown.enter="handleInputEnter" |
And then, like this method is called with no input.
marktext/src/renderer/mixins/index.js
Line 96 in aed36db
| handleInputEnter () { |
Versions
- MarkText version: master branch
- Operating system: MacOS 12.4
Activity
Jocs commentedon Jun 23, 2026
Thank you for reporting this and for the clear explanation of the IME double-Enter problem. The sidebar components have been rewritten since this was filed: the new
treeFolder.vueandtree.vueboth use@keypress.enter(and the rename dialog uses@keyup.enter) for all file/directory name inputs, which is the exact fix you suggested. This means the first IME composition Enter no longer triggers file creation. We're closing this as resolved. Please reopen if you can still reproduce it with the latest build.