Skip to content

Commit 81eeabe

Browse files
committed
Remove isEditable checks that prevent set string value
1 parent 826c00b commit 81eeabe

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

Sources/STTextView/STTextView+TextInputClient.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ extension STTextView: NSTextInputClient {
101101
}
102102

103103
open func insertText(_ string: Any, replacementRange: NSRange) {
104-
guard isEditable else { return }
105-
106104
let replacementTextRange = NSTextRange(replacementRange, in: textContentStorage)
107105
var textRanges = textLayoutManager.textSelections.flatMap(\.textRanges)
108106
if let replacementTextRange {

Sources/STTextView/STTextView.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,10 +853,6 @@ open class STTextView: NSView, NSTextInput {
853853
/// this method should be called with information on the change.
854854
/// Coalesce consecutive typing events
855855
open func shouldChangeText(in affectedTextRange: NSTextRange, replacementString: String?) -> Bool {
856-
if !isEditable {
857-
return false
858-
}
859-
860856
let result = delegate?.textView(self, shouldChangeTextIn: affectedTextRange, replacementString: replacementString) ?? true
861857
if !result {
862858
return result

0 commit comments

Comments
 (0)