ui: Prevent IME features at some places

This commit is contained in:
PapaTutuWawa 2022-01-10 12:00:23 +01:00
parent 8d3b0bc80c
commit fba5652036
2 changed files with 10 additions and 5 deletions

View File

@ -68,8 +68,7 @@ class LoginPage extends StatelessWidget {
viewModel.performLogin(jid, password); viewModel.performLogin(jid, password);
} }
@override @override Widget build(BuildContext context) {
Widget build(BuildContext context) {
return StoreConnector<MoxxyState, _LoginPageViewModel>( return StoreConnector<MoxxyState, _LoginPageViewModel>(
converter: (store) => _LoginPageViewModel( converter: (store) => _LoginPageViewModel(
togglePasswordVisibility: () => store.dispatch(TogglePasswordVisibilityAction()), togglePasswordVisibility: () => store.dispatch(TogglePasswordVisibilityAction()),
@ -104,7 +103,8 @@ class LoginPage extends StatelessWidget {
enabled: !viewModel.doingWork, enabled: !viewModel.doingWork,
controller: this.jidController, controller: this.jidController,
maxLines: 1, maxLines: 1,
cornerRadius: TEXTFIELD_RADIUS_REGULAR cornerRadius: TEXTFIELD_RADIUS_REGULAR,
enableIMEFeatures: false
) )
), ),
Padding( Padding(
@ -125,7 +125,8 @@ class LoginPage extends StatelessWidget {
enabled: !viewModel.doingWork, enabled: !viewModel.doingWork,
obscureText: !viewModel.showPassword, obscureText: !viewModel.showPassword,
maxLines: 1, maxLines: 1,
cornerRadius: TEXTFIELD_RADIUS_REGULAR cornerRadius: TEXTFIELD_RADIUS_REGULAR,
enableIMEFeatures: false
) )
), ),
Visibility( Visibility(

View File

@ -13,6 +13,7 @@ class CustomTextField extends StatelessWidget {
final bool enabled; final bool enabled;
final bool obscureText; final bool obscureText;
final bool isDense; final bool isDense;
final bool enableIMEFeatures; // suggestions and autocorrect
final int maxLines; final int maxLines;
final int minLines; final int minLines;
final TextEditingController? controller; final TextEditingController? controller;
@ -33,7 +34,8 @@ class CustomTextField extends StatelessWidget {
this.controller, this.controller,
this.onChanged, this.onChanged,
this.isDense = false, this.isDense = false,
this.contentPadding = TEXTFIELD_PADDING_REGULAR this.contentPadding = TEXTFIELD_PADDING_REGULAR,
this.enableIMEFeatures = true
}); });
@override @override
@ -55,6 +57,8 @@ class CustomTextField extends StatelessWidget {
enabled: this.enabled, enabled: this.enabled,
controller: this.controller, controller: this.controller,
onChanged: this.onChanged, onChanged: this.onChanged,
enableSuggestions: this.enableIMEFeatures,
autocorrect: this.enableIMEFeatures,
decoration: InputDecoration( decoration: InputDecoration(
labelText: this.labelText, labelText: this.labelText,
hintText: this.hintText, hintText: this.hintText,