Skip to content

Resolve crash within NavigationSplitView in v2.3.4#102

Merged
krzyzanowskim merged 1 commit intokrzyzanowskim:mainfrom
julianschiavo:julian/resolve-update-constraints-crash
Jan 14, 2026
Merged

Resolve crash within NavigationSplitView in v2.3.4#102
krzyzanowskim merged 1 commit intokrzyzanowskim:mainfrom
julianschiavo:julian/resolve-update-constraints-crash

Conversation

@julianschiavo
Copy link
Contributor

Hey! Per your recommendation, we (Bitrig) updated STTextView to v2.3.4 today. Unfortunately, this caused our app to crash on launch when using STTextView within a SwiftUI.NavigationSplitView.

Sample code:

struct ContentView: View {
    var body: some View {
        NavigationSplitView {
            Spacer()
        } detail: {
            TextView(
                text: .constant(.init("Wow"))
            )
            .font(.system(size: 12, weight: .regular, design: .monospaced))
        }
    }
}
Screenshot 2026-01-14 at 3 29 16 PM

I investigated the crash and believe it was caused by an invalidation loop from NavigationSplitView while STTextView is resizing during layout.

I found that implementing sizeThatFits to accept SwiftUI's size proposal resolves the crash.

We have already made this change in our internal source editor package. I'm making this PR to share the fix with other users as well in case it's helpful. Thank you!

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@krzyzanowskim krzyzanowskim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic! thank you

@krzyzanowskim krzyzanowskim merged commit 041b171 into krzyzanowskim:main Jan 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants