Skip to content

Commit

Permalink
Skip text field subviews
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin committed Aug 27, 2024
1 parent 53775ed commit 594396f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/SnapshotPreviewsCore/ScrollExpansion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ extension NSView: FirstScrollViewProviding {
var subviews = subviews
while !subviews.isEmpty {
let subview = subviews.removeFirst()
subviews.append(contentsOf: subview.subviews)
// Don’t expand NSTextView, it can cause flakes
if let scrollView = subview as? NSScrollView, !(scrollView.documentView is NSTextView) {
if let scrollView = subview as? NSScrollView {
// Don’t expand NSTextView, it can cause flakes
guard !(scrollView.documentView is NSTextView) else {
continue
}

return scrollView
}
subviews.append(contentsOf: subview.subviews)
}
return nil
}
Expand Down

0 comments on commit 594396f

Please sign in to comment.