Fixed hide disclosure triangle for Bank- and BankAccountListItems (issue was that you have to use "ForEach(0 ..< array.count) { index in" instead of "ForEach(array) item in" - very obvious, Apple!)
This commit is contained in:
parent
185e0e0271
commit
70b8a8b84c
|
@ -13,8 +13,8 @@ struct AccountsTab: View {
|
|||
VStack {
|
||||
if data.banks.isEmpty == false {
|
||||
Form {
|
||||
ForEach(data.banks) { bank in
|
||||
BankListItem(bank: bank)
|
||||
ForEach(0 ..< data.banks.count) { bankIndex in
|
||||
BankListItem(bank: self.data.banks[bankIndex])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,15 @@ struct BankAccountListItem : View {
|
|||
|
||||
|
||||
var body: some View {
|
||||
NavigationLink(destination: AccountTransactionsDialog(title: account.displayName, transactions: account.bookedTransactions)) {
|
||||
ZStack {
|
||||
HStack {
|
||||
Text(account.displayName)
|
||||
Spacer()
|
||||
}.frame(height: 35)
|
||||
|
||||
NavigationLink(destination: AccountTransactionsDialog(title: account.displayName, transactions: account.bookedTransactions)) {
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,18 +9,22 @@ struct BankListItem : View {
|
|||
|
||||
var body: some View {
|
||||
Section {
|
||||
NavigationLink(destination: AccountTransactionsDialog(title: bank.displayName, transactions: bank.accounts.flatMap { $0.bookedTransactions })) {
|
||||
ZStack {
|
||||
HStack {
|
||||
Text(bank.displayName)
|
||||
.font(.headline)
|
||||
|
||||
Spacer()
|
||||
}.frame(height: 35)
|
||||
|
||||
NavigationLink(destination: AccountTransactionsDialog(title: bank.displayName, transactions: bank.accounts.flatMap { $0.bookedTransactions })) {
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ForEach(bank.accounts) { account in
|
||||
BankAccountListItem(account: account)
|
||||
ForEach(0 ..< bank.accounts.count) { accountIndex in
|
||||
BankAccountListItem(account: self.bank.accounts[accountIndex])
|
||||
}
|
||||
.padding(.leading, 18)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue