mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-09 19:54:11 +01:00
fix: Behaviour of homeserver textfield
This commit is contained in:
parent
6728993c50
commit
2c8a8a4313
@ -29,7 +29,8 @@ class HomeserverPickerUI extends StatelessWidget {
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onChanged: (s) => controller.domain = s,
|
onChanged: (s) => controller.domain = s,
|
||||||
readOnly: !AppConfig.allowOtherHomeservers,
|
readOnly: !AppConfig.allowOtherHomeservers,
|
||||||
onSubmit: (_) => controller.checkHomeserverAction,
|
onSubmit: (_) => controller.checkHomeserverAction(),
|
||||||
|
unfocusOnClear: false,
|
||||||
),
|
),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
|
@ -14,6 +14,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
|||||||
final EdgeInsets padding;
|
final EdgeInsets padding;
|
||||||
final bool readOnly;
|
final bool readOnly;
|
||||||
final Widget prefixIcon;
|
final Widget prefixIcon;
|
||||||
|
final bool unfocusOnClear;
|
||||||
|
|
||||||
DefaultAppBarSearchField({
|
DefaultAppBarSearchField({
|
||||||
Key key,
|
Key key,
|
||||||
@ -27,6 +28,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
|||||||
this.padding,
|
this.padding,
|
||||||
this.readOnly = false,
|
this.readOnly = false,
|
||||||
this.prefixIcon,
|
this.prefixIcon,
|
||||||
|
this.unfocusOnClear = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -105,7 +107,7 @@ class DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
_searchController.clear();
|
_searchController.clear();
|
||||||
widget.onChanged?.call('');
|
widget.onChanged?.call('');
|
||||||
_focusNode.unfocus();
|
if (widget.unfocusOnClear) _focusNode.unfocus();
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: widget.suffix,
|
: widget.suffix,
|
||||||
|
Loading…
Reference in New Issue
Block a user