Resolves, but adds no tests cases to the test suite for #294. See the issue for the detailed description of the problem.
I will add end-to-end tests for this in future PRs.
I've tested these cases manually so far:
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
Group {
Text("true")
Text("true")
}
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
Note the `Group` view with multiple children in this one, it uncovered required checks for `GroupView` conformance.
Also tested these more simple cases:
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
Group {
// single child
Text("true")
}
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
and
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
// single child, no nesting
Text("true")
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
Property assignment does not update SVG elements. We may want to use properties instead of `setAttribute` in the future for optimizations. For now I think that `setAttribute` works in all cases, including SVG, and seems safer to me.
Resolves#278.
* Use setAttribute, not properties to fix SVG update
* Add HTMLAttribute to cleanly apply DOM updates
* Add doc comment to HTMLAttribute
* Update Sources/TokamakStaticHTML/Views/HTML.swift
Co-authored-by: Jed Fox <git@jedfox.com>
* Use static func property in TokamakDOM/TextField.swift
* Make `static func property` public
* Declare `static let value` on `HTMLAttribute`
Co-authored-by: Jed Fox <git@jedfox.com>
You can see the dark scheme environment text representation updated in `EnvironmentDemo`. I suggest adding default dark mode styles in a separate PR, I've created #237 as a reminder for that.