Skip to content

Fix IME input issues by implementing Ctrl/Cmd+Enter submission #17

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kahirokunn
Copy link

@kahirokunn kahirokunn commented Jun 4, 2025

Description

This PR fixes the issue where pressing Enter to confirm IME (Input Method Editor) input would inadvertently submit the form. This was particularly problematic for users typing in Japanese, Chinese, Korean, and other languages that use IME.

Changes

  • Removed automatic form submission on Enter key: The form no longer submits when pressing Enter alone, allowing IME users to confirm their input without triggering submission
  • Added keyboard shortcuts for submission:
    • Ctrl+Enter on Windows/Linux
    • Cmd+Enter on macOS
  • Preserved standard textarea behavior: Users can still insert line breaks using Shift+Enter

Problem it solves

Previously, when typing in languages that require IME (e.g., Japanese), pressing Enter to confirm character conversion would submit the form prematurely. This made it impossible to type multi-character words properly.

Before

  • Enter → Submits form (even during IME conversion)
  • No way to properly input IME-based languages

After

  • Enter → Confirms IME input / inserts line break
  • Ctrl/Cmd+Enter → Submits form
  • Shift+Enter → Inserts line break (unchanged)

Testing

  1. Test with IME-based input (Japanese, Chinese, Korean)

    • Type characters requiring conversion
    • Press Enter to confirm conversion
    • Verify form is NOT submitted
  2. Test form submission

    • Type any text
    • Press Ctrl+Enter (Windows/Linux) or Cmd+Enter (Mac)
    • Verify form IS submitted
  3. Test line breaks

    • Type text and press Shift+Enter
    • Verify new line is created

…d+Enter

- Remove automatic form submission on Enter key to prevent conflicts with IME
- Add Ctrl+Enter (Windows/Linux) and Cmd+Enter (Mac) as submission shortcuts
- Preserve native textarea behavior for line breaks with Shift+Enter
- Fix issue where Japanese/Chinese/Korean input confirmation triggered form submission
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant