Unity Version:
Unity 6000.0.38
Platform:
Tested on Windows (PC build, Editor)
This issue does not occur on Android (AOS).
Issue Description:
public void SendChat(string input)
{
if (string.IsNullOrEmpty(input))
return;
// send chat
m_InputField.text = string.Empty;
m_InputField.ActivateInputField();
}
When using a TMP_InputField with an IME (Korean, Japanese, Chinese input methods), the onSubmit() event does not include the final composing character in the submitted text. Instead, the last composing character remains in the input field.
For example, typing โ์ผ์๋ง์ฐ์์โ and pressing Enter results in:
onSubmit(string text)receiving โ์ผ์๋ง์ฐ์โ- The last character โ์โ remains in the input field instead of being included in the submitted text.
This happens because compositionString is not finalized before the submit event fires. The onSubmit() callback receives only the fully committed text, excluding any remaining composition characters.
Steps to Reproduce:
- Create a
TMP_InputFieldand attach anonSubmitlistener. - Type Korean text using an IME, ensuring that the last character is still being composed.
- Press Enter to submit the text.
- Observe that the last composing character is missing from the submitted string but remains in the input field.
This behavior differs from previous Unity versions(2022.3.31).
Of course, it is possible to manually append compositionString to the message when the onSubmit event fires. However, this does not seem like a proper solution.
Is there any mode setting or TMP configuration that I might have overlooked to control this behavior? Any advice would be appreciated!