-
-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[General]: Field not getting unfocused for modalBottomSheets or AlertDialogs if was in focused already #1441
Closed
3 of 7 tasks
Labels
bug
Something isn't working
Comments
Related with #1297 |
Hi!
Example: import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter FormBuilder Example',
debugShowCheckedModeBanner: false,
localizationsDelegates: const [
FormBuilderLocalizations.delegate,
...GlobalMaterialLocalizations.delegates,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: FormBuilderLocalizations.supportedLocales,
home: const _ExamplePage(),
);
}
}
class _ExamplePage extends StatefulWidget {
const _ExamplePage();
@override
State<_ExamplePage> createState() => _ExamplePageState();
}
class _ExamplePageState extends State<_ExamplePage> {
final _formKey = GlobalKey<FormBuilderState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: FormBuilder(
key: _formKey,
child: Column(
children: [
FormBuilderTextField(
name: 'full_name',
decoration: const InputDecoration(labelText: 'Full Name'),
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
]),
),
const SizedBox(height: 10),
ElevatedButton(
onPressed: () {
_formKey.currentState?.saveAndValidate();
debugPrint(_formKey.currentState?.value.toString());
},
child: const Text('Print'),
)
],
),
),
);
}
} Thanks a lot |
Maybe related with #1429 too |
Duplicated of #1429 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Package/Plugin version
9.5.0
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
Focus on any text field, the keyboard shows up. Now open any
modalBottomSheet
orshowDialog
, once they are closed the field goes back in focus causing the keyboard to come back to focus.Expected Behavior
The field should be
unfocused
if any other entity shows up on the screen and show remainedunfocued
afterwardsSteps To Reproduce
forgot password
button but you can use anyonTap
oronPressed
and try to open a modalSame happens with alert dialog box opened via
showDialog
methodAditional information
Screen.Recording.2024-12-02.at.2.44.01.PM.mov
The text was updated successfully, but these errors were encountered: