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

Enter key down as IME's convert-decision-operation accidentally send to standard input #16413

Open
Paalon opened this issue Jun 3, 2024 · 1 comment
Labels
bug tag:Keyboard Compatibility issues with keyboards, including locale-specific and layout-specific issues

Comments

@Paalon
Copy link

Paalon commented Jun 3, 2024

Description

We can't use decision-operation (確定)by enter-key on Japanese IME on macOS on Safari or Chrome with macOS standard Japanese IME or Google 日本語入力 (Google Japanese IME) on standard input like Python's input() in code block. There is no problem on Firefox.
Come from https://teratail.com/questions/4d0bm1aqv9tye5 (Japanese, StackOverflow-like site).

The table work or fail on environments

IME Safari Chrome Firefox
macOS Japanese IME fail fail work
Google 日本語入力 fail fail work

I only checked for macOS. I don't know there are problems for Windows or Ubuntu etc.

Reproduce

  1. Prepare macOS.
  2. Install Japanese IME (macOS Japanese IME (preinstalled) or Google 日本語入力)
  3. Write the following Python script in the code block:
text = input()
print(text)
  1. Run the code block.
  2. Input something (e.g. 今日はいい天気です) in Japanese IME and press enter key as convert-decision-operation.
  3. Accidentally, the content is send.

Expected behavior

The content is not send, only do convert-decision-operation.

Context

  • Operating System and version: macOS Ventura 13.6.7
  • Browser and version:
    • Chrome 125.0.6422.142 (not work)
    • Safari 17.5 (18618.2.12.111.5, 18618) (not work)
    • Firefox 126.0 (work well)
  • Jupyter Notebook version:
$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.23.0
ipykernel        : 6.29.4
ipywidgets       : not installed
jupyter_client   : 8.6.2
jupyter_core     : 5.7.2
jupyter_server   : 2.14.1
jupyterlab       : 4.2.1
nbclient         : 0.10.0
nbconvert        : 7.16.4
nbformat         : 5.10.4
notebook         : 7.2.0
qtconsole        : not installed
traitlets        : 5.14.3

Information

To use Japanese IME, convert-decision-operation is mandatory.
There is some notes about keydown event handling with Japanese IME:

Firefox(68.0.1)とWindowsのGoogle Chromee(75.0.3770.142)では期待通りに動作します。
MacのGoogle Chrome(75.0.3770.142)とSafari(12.1.2)では、日本語を入力するとき、期待通りに動作しません。

The post written 2020 says we need special treatment for macOS + Safari and macOS + Chrome, and don't need for macOS + Firefox and Windows + Chrome. And need to use KeyboardEvent.keyCode or keypress event but both of them are deprecated.

This post written in 2023 also uses KeyboardEvent.keyCode as a solution.

Moved from posted at jupyter/notebook#7389.

@Paalon Paalon added the bug label Jun 3, 2024
Copy link

welcome bot commented Jun 3, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Jun 3, 2024
@JasonWeill JasonWeill added tag:Keyboard Compatibility issues with keyboards, including locale-specific and layout-specific issues and removed status:Needs Triage Applied to new issues that need triage labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tag:Keyboard Compatibility issues with keyboards, including locale-specific and layout-specific issues
Projects
None yet
Development

No branches or pull requests

2 participants