fix: unfocus keyboard on click outside in activity planner page, add done button to final text field (#1732)
This commit is contained in:
parent
f9e2b3d9c0
commit
65149bb1fa
2 changed files with 9 additions and 1 deletions
|
|
@ -300,7 +300,7 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
|
|||
decoration: InputDecoration(
|
||||
labelText: l10n.numberOfLearners,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return l10n.mustBeInteger;
|
||||
|
|
@ -314,6 +314,13 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
|
|||
onChanged: (val) =>
|
||||
_selectedNumberOfParticipants = int.tryParse(val),
|
||||
initialValue: _selectedNumberOfParticipants?.toString(),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onFieldSubmitted: (_) {
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
_generateActivities();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton(
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class SuggestionFormField extends StatelessWidget {
|
|||
hintText: placeholder,
|
||||
),
|
||||
validator: validator,
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue