Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check switch usage in Alert and Dialog button builder #667

Open
PavelHolec opened this issue Aug 22, 2023 · 1 comment
Open

Check switch usage in Alert and Dialog button builder #667

PavelHolec opened this issue Aug 22, 2023 · 1 comment
Labels
accessibility Issues supporting accessibility features

Comments

@PavelHolec
Copy link
Collaborator

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 PavelHolec added the accessibility Issues supporting accessibility features label Aug 22, 2023
@sjavora
Copy link
Member

sjavora commented Mar 26, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Issues supporting accessibility features
Projects
None yet
Development

No branches or pull requests

2 participants