Skip to content

Commit

Permalink
Merge pull request #1192 from wordpress-mobile/hotfix/1.6.1.1
Browse files Browse the repository at this point in the history
Fix copy method to keep other text data when adding custom attributedstring data.
  • Loading branch information
SergioEstevao authored May 24, 2019
2 parents e16cdca + 6f91f8f commit 0caf089
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Aztec/Classes/TextKit/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,11 @@ open class TextView: UITextView {
// MARK: - Pasteboard Helpers

internal func storeInPasteboard(encoded data: Data, pasteboard: UIPasteboard = UIPasteboard.general) {
pasteboard.setData(data, forPasteboardType: NSAttributedString.pastesboardUTI)
if pasteboard.numberOfItems > 0 {
pasteboard.items[0][NSAttributedString.pastesboardUTI] = data;
} else {
pasteboard.addItems([[NSAttributedString.pastesboardUTI: data]])
}
}

// MARK: - Intercept keyboard operations
Expand Down

0 comments on commit 0caf089

Please sign in to comment.