In your initial code, you set tag(0) both line 24 and 34.
That may be the confusion ?
Change line 34 with tag(1).
Similarly, change line 46 to tag(0)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: