Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.1

- **FEAT**: Multi screen forms now auto-focus `Next` button on the summary screen to prioritise form submission.

## 0.10.0

- **BREAKING**: `ServerpodTerminalBackend`'s `preExit` now requires `exitCode`.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/form/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ class MultiScreenFormState extends FormState {
updateFocusedConfigOption(-currentFocus);
}
} else {
// Focus action buttons on summary screen.
focusDown();
// Focus action button on summary screen.
focusNextButton();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: serverpod_tui
description: A collection of tools for building terminal user interfaces.
version: 0.10.0
version: 0.10.1
repository: https://github.com/serverpod/serverpod_tui
homepage: https://serverpod.dev
issue_tracker: https://github.com/serverpod/serverpod_tui/issues
Expand Down
4 changes: 3 additions & 1 deletion test/form/multi_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void main() {

test(
'when navigating through all screens, '
'then the summary screen is reached',
'then the summary screen is reached and the Next button is focused',
() async {
final configCount = state.configScreenCount;

Expand All @@ -331,6 +331,7 @@ void main() {

expect(state.isSummary, isTrue);
expect(state.currentScreenIndex, configCount);
expect(state.focusedButtonIndex, 1);
},
);

Expand All @@ -347,6 +348,7 @@ void main() {

// Focus on buttons
await _sendKey(tester, LogicalKey.arrowDown);
await _sendKey(tester, LogicalKey.arrowLeft);
await _pump(tester);

// Space to press back button
Expand Down
Loading