JDK-8096136 : [ComboBox] Editable ComboBox doesn't handle IM events if it gets focus through focus traversal keys.
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8,8u20,8u40
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-10-14
  • Updated: 2021-06-16
  • Resolved: 2014-10-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u40Fixed
Related Reports
Relates :  
Description
Steps to reproduce:
1. Run HelloComboBox demo
2. Press Tab key several times to traverse focus to an editable ComboBox. Then the input caret blinks on the TextField of the ComboBox, and it seems the focus is on the TextField.
3. Invoke Chinese or Japanese input method.
4. Type soming to compose Chinese or Japanese text.
 
Problem: the composing text appears at the top-left of the screen, which means the ComboBox allows IME but doesn't handle input method events, the events are handled by the OS. (focus-traverse.png)

But if clicking mouse on the TextField of the ComboBox to get focus, it works fine, the composing text appears on the spot of the caret. (mouse-click-focus.png)

It looks like when using focus traversal keys, the focus is actually on the ComboBox itself, not on the TextField. The ComboBox itself doesn't handle IM events. 
Comments
Verified fix with 8u40 b13.
07-11-2014

Changeset http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/8af967267405
24-10-2014

ok, if that is the case then ignore my only piece of feedback! It's a +1 from me.
23-10-2014

I only copied the pattern used in TextInputControlSkin. I think Scene relies on getOnInputMethodTextChanged() != null in order to enable IM events.
23-10-2014

Other than making that change, it looks fine to me: +1.
23-10-2014

I'm not familiar with the input method APIs, but it should be possible to simplify the code in both classes - rather than checking if the comboBox.getOnInputMethodTextChanged() == null and only setting the listener in that case, you could do the following and always install it: control.addEventHandler(InputMethodEvent.ANY, e -> { });
23-10-2014

Webrev for review: http://cr.openjdk.java.net/~leifs/rt38978/
23-10-2014