Skip to content

Commit

Permalink
Fix distance field staying highlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonp2412 committed Apr 25, 2024
1 parent 6ec8c31 commit 78c5718
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/start_plan_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _StartPlanPageState extends State<StartPlanPage> {
final _weightController = TextEditingController(text: "0.0");
final _distanceController = TextEditingController(text: "0.0");
final _durationController = TextEditingController(text: "0.0");
final _distanceNode = FocusNode();
final _durationNode = FocusNode();
final _repsNode = FocusNode();
final _weightNode = FocusNode();
Expand Down Expand Up @@ -253,6 +254,7 @@ class _StartPlanPageState extends State<StartPlanPage> {
),
if (_cardio) ...[
TextField(
focusNode: _distanceNode,
controller: _distanceController,
decoration: const InputDecoration(
labelText: 'Distance',
Expand All @@ -266,10 +268,6 @@ class _StartPlanPageState extends State<StartPlanPage> {
},
onSubmitted: (value) {
_durationNode.requestFocus();
_durationController.selection = TextSelection(
baseOffset: 0,
extentOffset: _durationController.text.length,
);
},
),
TextField(
Expand Down

0 comments on commit 78c5718

Please sign in to comment.