Skip to content

Commit

Permalink
update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzanowskim committed Aug 9, 2024
1 parent a9082ec commit 52002a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/STTextViewSwiftUIAppKit/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,26 @@ private struct TextViewRepresentable: NSViewRepresentable {

if textView.selectedRange() != selection, let selection {
textView.setSelectedRange(selection)
textView.needsLayout = true
}

if textView.isEditable != isEnabled {
textView.isEditable = isEnabled
textView.needsLayout = true
}

if textView.isSelectable != isEnabled {
textView.isSelectable = isEnabled
textView.needsLayout = true
}

if textView.font != font {
textView.font = font
textView.needsLayout = true
}

if options.contains(.wrapLines) != textView.isHorizontallyResizable {
textView.isHorizontallyResizable = !options.contains(.wrapLines)
textView.needsLayout = true
}

textView.needsLayout = true
textView.needsDisplay = true
}

func makeCoordinator() -> TextCoordinator {
Expand Down

0 comments on commit 52002a6

Please sign in to comment.