orbit-swiftui icon indicating copy to clipboard operation
orbit-swiftui copied to clipboard

Check `switch` usage in `Alert` and `Dialog` button builder

Open PavelHolec opened this issue 1 year ago • 1 comments

The accessibility of buttons seems to be broken when using a switch. The labels are correct, but the primary accessibility ID is used for all buttons.

PavelHolec avatar Aug 22 '23 15:08 PavelHolec

We ran into this internally when updating Dialog modifiers. IIRC, it's a consequence of buildEither's return value getting forwarded to

public static func buildBlock(_ primary: some View) -> some View {
    primaryButton(primary)
}

...which then applies the primaryButton to whatever is inside, including a stack of multiple buttons. We can't solve this by overloading buildBlock for Button, because that would only work without modifiers...

I guess we could try adding an overload that explicitly takes a _ConditionalContent...

sjavora avatar Mar 26 '24 13:03 sjavora