fix: Behaviour of homeserver textfield

This commit is contained in:
Christian Pauly 2021-05-01 07:40:12 +02:00
parent 6728993c50
commit 2c8a8a4313
2 changed files with 5 additions and 2 deletions

View File

@ -29,7 +29,8 @@ class HomeserverPickerUI extends StatelessWidget {
padding: EdgeInsets.zero,
onChanged: (s) => controller.domain = s,
readOnly: !AppConfig.allowOtherHomeservers,
onSubmit: (_) => controller.checkHomeserverAction,
onSubmit: (_) => controller.checkHomeserverAction(),
unfocusOnClear: false,
),
elevation: 0,
),

View File

@ -14,6 +14,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
final EdgeInsets padding;
final bool readOnly;
final Widget prefixIcon;
final bool unfocusOnClear;
DefaultAppBarSearchField({
Key key,
@ -27,6 +28,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
this.padding,
this.readOnly = false,
this.prefixIcon,
this.unfocusOnClear = true,
}) : super(key: key);
@override
@ -105,7 +107,7 @@ class DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
onPressed: () {
_searchController.clear();
widget.onChanged?.call('');
_focusNode.unfocus();
if (widget.unfocusOnClear) _focusNode.unfocus();
},
)
: widget.suffix,