fix: Add button moved to sticky bottom bar — always tappable on first tap
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s

- Button outside ScrollView using safeAreaInset(edge: .bottom)
- No more scroll gesture eating the first tap
- scrollDismissesKeyboard(.immediately) for keyboard handling
- Swipe to delete on meal entries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 11:15:53 -05:00
parent d95c629845
commit b78e230eda

View File

@@ -165,8 +165,12 @@ struct AddFoodSheet: View {
.font(.caption) .font(.caption)
.foregroundStyle(.red) .foregroundStyle(.red)
} }
}
// Add button .padding()
}
.scrollDismissesKeyboard(.immediately)
.background(Color.canvas)
.safeAreaInset(edge: .bottom) {
Button { Button {
addEntry() addEntry()
} label: { } label: {
@@ -184,10 +188,10 @@ struct AddFoodSheet: View {
.foregroundStyle(.white) .foregroundStyle(.white)
.clipShape(RoundedRectangle(cornerRadius: 12)) .clipShape(RoundedRectangle(cornerRadius: 12))
.disabled(isAdding) .disabled(isAdding)
} .padding(.horizontal)
.padding() .padding(.bottom, 8)
}
.background(Color.canvas) .background(Color.canvas)
}
.navigationTitle("Add Food") .navigationTitle("Add Food")
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
.toolbar { .toolbar {