Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/EnsembleUI/ensemble into 97…
Browse files Browse the repository at this point in the history
…1-actions-in-js
  • Loading branch information
Nehal Jaisalmeria authored and Nehal Jaisalmeria committed Dec 6, 2023
2 parents 9503dd0 + d72e67e commit f7070f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions assets/schema/ensemble_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,10 @@
"type": "boolean",
"description": "enable the toggling between plain and obscure text."
},
"toolbarDone": {
"type": "boolean",
"description": "enable the toolbar with done button in the TextInput. (defaults to False)"
},
"enableClearText": {
"type": "boolean",
"description": "It enables the default suffix clear icon button for the text input field to clear the values. Default (false)"
Expand Down
8 changes: 5 additions & 3 deletions lib/widget/input/form_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ abstract class BaseTextInput extends StatefulWidget
_controller.enableClearText = Utils.optionalBool(value),
'obscureToggle': (value) =>
_controller.obscureToggle = Utils.optionalBool(value),
'toolbarDone': (value) =>
_controller.toolbarDoneButton = Utils.optionalBool(value),
'keyboardAction': (value) =>
_controller.keyboardAction = _getKeyboardAction(value),
'maxLines': (value) => _controller.maxLines =
Expand Down Expand Up @@ -200,6 +202,8 @@ class TextInputController extends FormFieldController {
// applicable only for Password or obscure TextInput, to toggle between plain and secure text
bool? obscureToggle;

bool? toolbarDoneButton;

model.InputValidator? validator;
String? inputType;
String? mask;
Expand All @@ -223,9 +227,7 @@ class TextInputState extends FormFieldWidgetState<BaseTextInput>
late List<TextInputFormatter> _inputFormatter;
OverlayEntry? overlayEntry;
bool get toolbarDoneStatus {
final status = widget.keyboardType == TextInputType.phone ||
widget.keyboardType == TextInputType.number;
return status;
return widget.controller.toolbarDoneButton ?? false;
}

void evaluateChanges() {
Expand Down

0 comments on commit f7070f7

Please sign in to comment.