improved the text editors (replaced em with textfields)
This commit is contained in:
parent
c49db28ff6
commit
d4b1226ef3
@ -19,11 +19,13 @@ struct CardsView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
List {
|
||||||
Section {
|
// Section {
|
||||||
TextEditor(text: $newCardText)
|
// TextEditor(text: $newCardText)
|
||||||
} header: {
|
// } header: {
|
||||||
Text("Add new card")
|
// Text("Add new card")
|
||||||
}
|
// }
|
||||||
|
TextField("Add New Card", text: $newCardText, axis: .vertical)
|
||||||
|
.lineLimit(.max)
|
||||||
Section {
|
Section {
|
||||||
ForEach(project.sortedCards) { card in
|
ForEach(project.sortedCards) { card in
|
||||||
Text(card.content)
|
Text(card.content)
|
||||||
@ -38,6 +40,7 @@ struct CardsView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.scrollDismissesKeyboard(.immediately)
|
||||||
.navigationTitle(project.name)
|
.navigationTitle(project.name)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
@ -16,8 +16,10 @@ struct EditCardView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
Form {
|
Form {
|
||||||
TextEditor(text: $text)
|
// TextEditor(text: $text)
|
||||||
.frame(minHeight: 100)
|
// .foregroundStyle(.secondary)
|
||||||
|
TextField("Edit Card Text", text: $text, axis: .vertical)
|
||||||
|
.lineLimit(.max)
|
||||||
}
|
}
|
||||||
.navigationTitle("Edit Card")
|
.navigationTitle("Edit Card")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
@ -38,6 +40,6 @@ struct EditCardView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
@State var test = ""
|
@State var test = "PreviewData.project.cards[4].con\ntentblabla\nksbdlaskdlaksd\naklsdbal\nkbsdal\nkbsdlasbd\nsdkfnsdlkfm"
|
||||||
return EditCardView(text: $test) { _ in }
|
return EditCardView(text: $test) { _ in }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user