File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -73,18 +73,21 @@ struct ViewTreeBuilder<R: RootRegistry> {
7373
7474 let modified = view. applyModifiers ( R . self)
7575 let bound = applyBindings ( to: modified, element: element, context: context)
76- let withID = applyID ( element: element, to: bound)
77- return withID
76+ let withIDAndTag = applyIDAndTag ( element: element, to: bound)
77+
78+ return withIDAndTag
7879 . environment ( \. element, element)
7980 . preference ( key: ProvidedBindingsKey . self, value: [ ] ) // reset for the next View.
8081 }
8182
8283 @ViewBuilder
83- private func applyID( element: ElementNode , to view: some View ) -> some View {
84+ private func applyIDAndTag( element: ElementNode , to view: some View ) -> some View {
85+ let tag = element. attributeValue ( for: " tag " )
86+
8487 if let id = element. attributeValue ( for: " id " ) {
85- view. id ( id)
88+ view. id ( id) . tag ( tag )
8689 } else {
87- view
90+ view. tag ( tag )
8891 }
8992 }
9093
You can’t perform that action at this time.
0 commit comments