Here's the simplified code:
var body: some View {
Section(header: Text("Personal Data").position(x:45, y: 17)) {
Form {
VStack {
TextField("Title", text: self.$title)
.disabled(true)
.overlay(
Button("", action: {
self.showTitles = true
}))
.popover(isPresented: self.$showTitles, attachmentAnchor: .point(.bottom)) { EmptyView() }
Divider()
TextField("Name", text: $firstName)
Divider()
TextField("Last Name", text: $lastName)
}
.padding()
.padding(.bottom, -7)
.overlay(
RoundedRectangle(cornerRadius: 6.0)
.stroke(Color.secondary, lineWidth: 1.0)
.opacity(0.3)
)
}
}
}
It was working as I wanted before adding the VStack although I need it to be able to place Dividers. I've tried to wrap the single TextField with a VStack and also used Group to see if I can only have button overlay on the the first TextField but nothing seems to work. Do I have to use GeometryReader for this purpose?
I'd appreciate it if anyone can provide some insights.