Skip to content

SwiftUI TextEditor bounding box does not render properly  #202

Description

@DavidBrunow

Given this snapshot test:

    @available(iOS 14.0, *)
    func testTextEditor() {
        let textEditor = TextEditor(text: .constant(""))
            .frame(
                width: UIScreen.main.bounds.width,
                height: UIScreen.main.bounds.height
            )
            .border(Color.black)

        assertSnapshot(
            matching: textEditor,
            as: .accessibilityImage,
            named: nameForDevice()
        )
    }

The library renders this snapshot where the accessibility bounding box does not match the text editor's frame (note that the missing description for the Text Field is being worked in #186):
testTextEditor 393x852-16-4-3x

This misrendering does not occur if the text editor is wrapped in a UIHostingController before calling assertSnapshot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: High PriorityIssues that would result in incorrectly accessing whether or not a view is accessible.Switch Control parityMismatch between output of framework and actual Switch Control behaviorVoice Control parityMismatch between output of framework and actual Voice Control behaviorVoiceOver parityMismatch between output of framework and actual VoiceOver behaviorbugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions