summaryrefslogtreecommitdiff
path: root/internal/client/ui/core/core.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-25 23:49:40 +0200
committerKyren223 <Kyren223@proton.me>2024-11-25 23:49:40 +0200
commitb05e4fcbcb59bdf20ca7b3e27f8ed15fea594cad (patch)
tree96dbcdf57b6e2958d99a803197f5b3210f0c5bc5 /internal/client/ui/core/core.go
parentd12ebef2c5b1fdc17d4151f752d4e4d95f6e56b3 (diff)
Added typing and input validation to network creation popup
Diffstat (limited to 'internal/client/ui/core/core.go')
-rw-r--r--internal/client/ui/core/core.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go
index 070ab16..fba3ddb 100644
--- a/internal/client/ui/core/core.go
+++ b/internal/client/ui/core/core.go
@@ -137,7 +137,17 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.networkCreationPopup = &popup
}
- default:
+ case tea.KeyEscape:
+ if m.networkCreationPopup != nil {
+ m.networkCreationPopup = nil
+ }
+
+ case tea.KeyEnter:
+ if m.networkCreationPopup != nil {
+ return m, m.networkCreationPopup.Select()
+ }
+
+ default:
if m.networkCreationPopup != nil {
popup, cmd := m.networkCreationPopup.Update(msg)
m.networkCreationPopup = &popup