Set the IME action label to null if the label is null in the configuration JSON object (flutter/engine#3199)
(JSONObject.getString() will return the string "null" for a JSON null value) Fixes https://github.com/flutter/flutter/issues/6643
This commit is contained in:
@@ -28,4 +28,8 @@ public abstract class JSONMessageListener implements FlutterView.OnMessageListen
|
||||
}
|
||||
|
||||
public abstract JSONObject onJSONMessage(FlutterView view, JSONObject message) throws JSONException;
|
||||
|
||||
public static String getStringOrNull(JSONObject object, String name) throws JSONException {
|
||||
return object.isNull(name) ? null : object.getString(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TextInputPlugin extends JSONMessageListener {
|
||||
return null;
|
||||
try {
|
||||
outAttrs.inputType = inputTypeFromTextInputType(mConfiguration.getString("inputType"));
|
||||
outAttrs.actionLabel = mConfiguration.getString("actionLabel");
|
||||
outAttrs.actionLabel = getStringOrNull(mConfiguration, "actionLabel");
|
||||
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN;
|
||||
InputConnectionAdaptor connection = new InputConnectionAdaptor(view, mClient);
|
||||
if (mIncomingState != null) {
|
||||
|
||||
Reference in New Issue
Block a user