Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[macOS] Combo allows the Enter press to complete IME to trigger default button

Đang mở
#3,312 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, macos
Lĩnh vực
desktop

Hướng nghiên cứu

Start with the macOS implementation of SWT Combo and its keyboard/input-method event handling; the issue does not name a source file or test. Reproduce with the supplied Java snippet using the Japanese - Kana layout, then check that Enter accepts an active IME composition without activating the shell's default button, while Enter with no popup still activates it.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug
When using the "Japanese - Kana" keyboard layout, a popup with some suggestions may occur. Pressing Enter there should accept the selection to produce some "Japanese characters/words" in the underlying control. Nothing else. However, doing that with an editable Combo pressing Enter also triggers the default button in that shell which should not be possible while a IME popup is still visible.

To Reproduce

  • run this snippet
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class ComboBoxTest {

	public static void main(String[] args) {
		final Display display = new Display();

		final Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));

		final Combo combo = new Combo(shell, SWT.BORDER);
		combo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

		final Button button = new Button(shell, SWT.PUSH);
		button.setText("Push me!");
		button.setLayoutData(new GridData(SWT.END, SWT.FILL, false, false));
		shell.setDefaultButton(button);
		button.addListener(SWT.Selection, event -> System.out.println("Button pressed"));

		shell.setSize(400, 300);
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}

		display.dispose();
	}
}
  • select "Japanese - Kana" keyboard layout
  • type some characters, e.g. abc until a popup occurs; press Enter; a blue underline occurs, press Enter again

Expected behavior
The character(s) shown in the popup should be accepted. Only when no IME popup is shown, an Enter press must trigger a default button.

Screenshots
https://github.com/user-attachments/assets/3457ca4d-b6e7-4097-bcfa-ddab9c58c079

Environment:

  1. Select the platform(s) on which the behavior is seen:
  • All OS
  • Windows
  • Linux
  • macOS
Ngôn ngữ chính
Java
Star
202
Fork
206
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
109

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-platform/eclipse.platform.swt

Tất cả issue của eclipse-platform/eclipse.platform.swt

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.