You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure when this started happening, but it seems like Button labels get duplicated now. Take this code:
structContentView:View{@Statevaractive=falsevarbody:someView{Button{
active.toggle()} label:{Text("Toggle").onChange(of: active){ newValue inprint("Active changed to: \(newValue)")}}}}
It renders fine , but check the console:
Active changed to: true
Active changed to: true
Why is Active changed to: true printed twice?
This affects WindowReader — the window gets stored in one of the duplicate view copies sometimes, and might not be correct until you scroll, rotate the device, or do a bounds change.
There seem to be some issues with
UIViewRepresentable
s created multiple times in iOS 16 — see https://stackoverflow.com/questions/73016607/swiftui-button-label-rendered-twice.This affects
WindowReader
— the window gets stored in one of the duplicate view copies sometimes, and might not be correct until you scroll, rotate the device, or do a bounds change.I've filed feedback
FB10758896 (SwiftUI - button label rendered twice)
The text was updated successfully, but these errors were encountered: