improved the text editors (replaced em with textfields)

This commit is contained in:
breadone 2024-06-25 20:33:46 +12:00
parent c49db28ff6
commit d4b1226ef3
No known key found for this signature in database
2 changed files with 13 additions and 8 deletions

View File

@ -19,11 +19,13 @@ struct CardsView: View {
var body: some View {
List {
Section {
TextEditor(text: $newCardText)
} header: {
Text("Add new card")
}
// Section {
// TextEditor(text: $newCardText)
// } header: {
// Text("Add new card")
// }
TextField("Add New Card", text: $newCardText, axis: .vertical)
.lineLimit(.max)
Section {
ForEach(project.sortedCards) { card in
Text(card.content)
@ -38,6 +40,7 @@ struct CardsView: View {
}
}
.scrollDismissesKeyboard(.immediately)
.navigationTitle(project.name)
.navigationBarTitleDisplayMode(.inline)
.toolbar {

View File

@ -16,8 +16,10 @@ struct EditCardView: View {
var body: some View {
NavigationView {
Form {
TextEditor(text: $text)
.frame(minHeight: 100)
// TextEditor(text: $text)
// .foregroundStyle(.secondary)
TextField("Edit Card Text", text: $text, axis: .vertical)
.lineLimit(.max)
}
.navigationTitle("Edit Card")
.navigationBarTitleDisplayMode(.inline)
@ -38,6 +40,6 @@ struct EditCardView: View {
}
#Preview {
@State var test = ""
@State var test = "PreviewData.project.cards[4].con\ntentblabla\nksbdlaskdlaksd\naklsdbal\nkbsdal\nkbsdlasbd\nsdkfnsdlkfm"
return EditCardView(text: $test) { _ in }
}