Skip to content

[BUG] contents behind modal still read by VoiceOver #186

@KaylaBrady

Description

@KaylaBrady

Prerequisites

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

Please describe the behavior you are expecting

When a modal is displayed and VoiceOver is turned on, I would expect that only the contents of the modal would be reachable. As described in the docs for isModal:

Use this trait to restrict which accessibility elements an assistive technology can navigate. When a modal accessibility element is visible, sibling accessibility elements that are not modal are ignored.

As a modal, I would expect that a popup would be the only reachable content when displayed by default. I attempted to add the isModal accessibility trait at various levels in my project and within Popups without success.

Current Behavior

What is the current behavior?

The contents of the sheet behind a CenterPopup are still read alound by VoiceOver when the popup is displayed.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Turn on Voice Over
  2. Activate the button to display the popup
  3. Navigate through views, confirm that the text elements in the sheet are still read aloud

Code Sample

If you can, please include a code sample that we can use to debug the bug.

While using Setup Option #2: SceneDelegate

struct ContentView: View {
@State var presentSheet = true

    var body: some View {
        VStack {
            Text("Base")
        }.sheet(isPresented: $presentSheet) {
            VStack {
                Text("This is in the Sheet")
                Button("Present the Modal") {
                    Task {
                        await CustomPopup().present()
                    }
                }
            }.presentationDetents([.fraction(0.25)])
                .presentationBackgroundInteraction(.enabled)
        }
    }
}

    struct CustomPopup: CenterPopup {
        var body: some View {
            VStack {
                Text("This is in the popup")
                Button("Close") {
                    Task {
                        await PopupStack.dismissAllPopups()
                    }
                }
            }
        }
    }

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Name Version
SDK 4.0.1
Xcode 16.4
Operating System iOS 18.5
Device iPhone 13

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions