Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit c8b1ee7

Browse files
authored
Merge pull request #252 from Unity-Technologies/fix_text_input_action_issue
Fix TextInputAction for desktop
2 parents 94a339b + 6e0e5bc commit c8b1ee7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

com.unity.uiwidgets/Runtime/services/keyboard.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class DefaultKeyboardDelegate : KeyboardDelegate, TextInputOnGUIListener {
6767

6868
TextEditingValue _value;
6969

70+
TextInputConfiguration _textInputConfiguration;
71+
7072
public void show() {
7173
}
7274

@@ -108,10 +110,12 @@ public void setIMEPos(Offset imeGlobalPos) {
108110

109111
public void setClient(int client, TextInputConfiguration configuration) {
110112
_client = client;
113+
_textInputConfiguration = configuration;
111114
}
112115

113116
public void clearClient() {
114117
_client = 0;
118+
_textInputConfiguration = null;
115119
}
116120

117121
public bool imeRequired() {
@@ -161,7 +165,8 @@ public void OnGUI() {
161165
}
162166

163167
if (ch == '\n') {
164-
Timer.create(TimeSpan.Zero, () => { TextInput._performAction(_client, TextInputAction.newline); });
168+
Timer.create(TimeSpan.Zero, () => { TextInput._performAction(_client,
169+
_textInputConfiguration?.inputAction ?? TextInputAction.newline); });
165170
}
166171

167172
if (_validateCharacter(ch)) {

0 commit comments

Comments
 (0)