Skip to content

Commit

Permalink
Align Meal Note to right.
Browse files Browse the repository at this point in the history
Add hide text keyboard button.
  • Loading branch information
Jon-b-m authored and mountrcg committed Aug 14, 2023
1 parent b2bc1c7 commit e297e7b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions FreeAPS/Sources/Modules/AddCarbs/View/AddCarbsRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extension AddCarbs {
@State var isPromtPresented = false
@State var saved = false
@State private var showAlert = false
@State var displayNote = false
@FocusState private var isFocused: Bool

@FetchRequest(
entity: Presets.entity(),
Expand Down Expand Up @@ -56,8 +56,12 @@ extension AddCarbs {
}
HStack {
Text("Note").foregroundColor(.secondary)
TextField("", text: $state.note).frame(maxWidth: .infinity, alignment: .trailing)
}
TextField("", text: $state.note).multilineTextAlignment(.trailing)
if state.note != "", isFocused {
Button { isFocused = false } label: { Image(systemName: "keyboard.chevron.compact.down") }
.controlSize(.mini)
}
}.focused($isFocused)
HStack {
Button {
state.useFPUconversion.toggle()
Expand Down

0 comments on commit e297e7b

Please sign in to comment.