Repository navigation
Bug fix: Malfunction of @keydown.enter when inputting Japanese on MacOS - #3419
196Ikuchil wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.enterto@keypress.enterin folder/file items. - Switched sidebar “new file/folder” inputs from
@keydown.enterto@keypress.enterat 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.
| class="rename" | ||
| v-if="renameCache === folder.pathname" | ||
| v-model="newName" | ||
| ref="renameInput" | ||
| @keydown.enter="rename" | ||
| @keypress.enter="rename" | ||
| > |
| 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" |
| 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" |
|
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.
|
|
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 If it does, please rebase against |
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.)