Skip to content
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

Pressing down "Tab" collides with IME when editing. #3026

Closed
jjaychen1e opened this issue Mar 2, 2024 · 0 comments · Fixed by #3027
Closed

Pressing down "Tab" collides with IME when editing. #3026

jjaychen1e opened this issue Mar 2, 2024 · 0 comments · Fixed by #3027
Labels
bug Something isn't working

Comments

@jjaychen1e
Copy link
Contributor

Describe the bug

if (event.key === "Tab") {
event.preventDefault();
const tabSpace = " ".repeat(TAB_SPACE_WIDTH);
const cursorPosition = editorRef.current.getCursorPosition();
const selectedContent = editorRef.current.getSelectedContent();
editorRef.current.insertText(tabSpace);
if (selectedContent) {
editorRef.current.setCursorPosition(cursorPosition + TAB_SPACE_WIDTH);
}
return;
}
};

Pressing down "Tab" will force IME to stop working and insert temporary characters into the editor.

image

Steps to reproduce

  1. Focus on an editor area
  2. Use IME such as Chinese Pinyin
  3. Type some characters then press down "Tab" Key

The version of Memos you're using

v0.20.0

Screenshots or additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant