Skip to content

Commit

Permalink
fix expand text view (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin authored Aug 26, 2024
1 parent 7c0e0c6 commit 53775ed
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/SnapshotPreviewsCore/ScrollExpansion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,9 @@ extension NSView: FirstScrollViewProviding {
var subviews = subviews
while !subviews.isEmpty {
let subview = subviews.removeFirst()
// Don’t expand NSTextView, it can cause flakes
guard !(subview is NSTextView) else {
continue
}

subviews.append(contentsOf: subview.subviews)
if let scrollView = subview as? NSScrollView {
// Don’t expand NSTextView, it can cause flakes
if let scrollView = subview as? NSScrollView, !(scrollView.documentView is NSTextView) {
return scrollView
}
}
Expand Down

0 comments on commit 53775ed

Please sign in to comment.