mirror of
https://github.com/AppFlowy-IO/AppFlowy
synced 2026-05-05 22:48:27 +00:00
chore(mobile): dismiss the keyboard when tap outside on login (#6183)
This commit is contained in:
parent
d9dc132e5b
commit
3161dddb25
2 changed files with 7 additions and 0 deletions
|
|
@ -21,10 +21,12 @@ class SignInWithMagicLinkButtons extends StatefulWidget {
|
|||
class _SignInWithMagicLinkButtonsState
|
||||
extends State<SignInWithMagicLinkButtons> {
|
||||
final controller = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
_focusNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +39,7 @@ class _SignInWithMagicLinkButtonsState
|
|||
height: PlatformExtension.isMobile ? 38.0 : 48.0,
|
||||
child: FlowyTextField(
|
||||
autoFocus: false,
|
||||
focusNode: _focusNode,
|
||||
controller: controller,
|
||||
borderRadius: BorderRadius.circular(4.0),
|
||||
hintText: LocaleKeys.signIn_pleaseInputYourEmail.tr(),
|
||||
|
|
@ -49,6 +52,7 @@ class _SignInWithMagicLinkButtonsState
|
|||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
onSubmitted: (_) => _sendMagicLink(context, controller.text),
|
||||
onTapOutside: (_) => _focusNode.unfocus(),
|
||||
),
|
||||
),
|
||||
const VSpace(12),
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class FlowyTextField extends StatefulWidget {
|
|||
final bool readOnly;
|
||||
final Color? enableBorderColor;
|
||||
final BorderRadius? borderRadius;
|
||||
final Function(PointerDownEvent)? onTapOutside;
|
||||
|
||||
const FlowyTextField({
|
||||
super.key,
|
||||
|
|
@ -76,6 +77,7 @@ class FlowyTextField extends StatefulWidget {
|
|||
this.readOnly = false,
|
||||
this.enableBorderColor,
|
||||
this.borderRadius,
|
||||
this.onTapOutside,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -161,6 +163,7 @@ class FlowyTextFieldState extends State<FlowyTextField> {
|
|||
},
|
||||
onSubmitted: _onSubmitted,
|
||||
onEditingComplete: widget.onEditingComplete,
|
||||
onTapOutside: widget.onTapOutside,
|
||||
minLines: 1,
|
||||
maxLines: widget.maxLines,
|
||||
maxLength: widget.maxLength,
|
||||
|
|
|
|||
Loading…
Reference in a new issue