Revert intended changes

This commit is contained in:
Kenta Kubo 2023-04-25 02:32:16 +09:00
parent f9bb5dbdf9
commit d61e4c7a1b

View file

@ -15,26 +15,20 @@ extension DoHSections: View {
var body: some View { var body: some View {
Section { Section {
ForEach(0..<self.configuration.servers.count, id: \.self) { i in ForEach(0..<self.configuration.servers.count, id: \.self) { i in
NavigationLink { TextField(
TextField( "IP address",
"IP address", text: .init(
text: .init( get: { self.configuration.servers[i] },
get: { self.configuration.servers[i] }, set: {
set: { self.configuration.servers[i] = $0
self.configuration.servers[i] = $0 .trimmingCharacters(in: .whitespacesAndNewlines)
.trimmingCharacters(in: .whitespacesAndNewlines) }
}
)
) )
.textContentType(.URL) )
.keyboardType(.numbersAndPunctuation) .textContentType(.URL)
.textInputAutocapitalization(.never) .keyboardType(.numbersAndPunctuation)
.autocorrectionDisabled() .textInputAutocapitalization(.never)
} label: { .autocorrectionDisabled()
Text("IP address")
Spacer()
Text(self.configuration.servers[i])
}
} }
.onDelete { self.configuration.servers.remove(atOffsets: $0) } .onDelete { self.configuration.servers.remove(atOffsets: $0) }
.onMove { self.configuration.servers.move(fromOffsets: $0, toOffset: $1) } .onMove { self.configuration.servers.move(fromOffsets: $0, toOffset: $1) }