Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
disabling auto correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Mar 8, 2024
1 parent e77f777 commit 59fb5bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ struct UITextViewWrapper: UIViewRepresentable {
functionName: #function
)
didUpdateText()
textView.toggleAutocorrectionIfNeeded()
// Disabled always until we fix the predictive text issue
// textView.toggleAutocorrectionIfNeeded()
textView.invalidateIntrinsicContentSize()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ public class WysiwygComposerViewModel: WysiwygComposerViewModelProtocol, Observa
/// The textView that the model currently manages, a default text view is provided, but you should always inject it from the UIWrapper
public lazy var textView = {
let textView = WysiwygTextView()
// Disabled until we fix the issue with the predictive text
textView.autocorrectionType = .no
textView.linkTextAttributes[.foregroundColor] = parserStyle.linkColor
textView.mentionDisplayHelper = mentionDisplayHelper
textView.apply(attributedContent)
return textView
}() {
didSet {
// Disabled until we fix the issue with the predictive text
textView.autocorrectionType = .no
textView.linkTextAttributes[.foregroundColor] = parserStyle.linkColor
textView.mentionDisplayHelper = mentionDisplayHelper
textView.apply(attributedContent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
@testable import WysiwygComposer
import XCTest

// THESE TESTS ARE DISABLED UNTIL WE FIX THE PREDICTIVE TEXT ISSUE
extension WysiwygComposerViewModelTests {
func testAutocorrectionIsDisabled() throws {
func disabled_testAutocorrectionIsDisabled() throws {
mockTrailingTyping("/")
assertAutocorrectDisabled()

Expand All @@ -29,20 +30,20 @@ extension WysiwygComposerViewModelTests {
assertAutocorrectDisabled()
}

func testAutocorrectionIsEnabled() throws {
func disabled_testAutocorrectionIsEnabled() throws {
mockTrailingTyping("Just some text")
assertAutoCorrectEnabled()

mockTrailingTyping(" /not_a_command")
assertAutoCorrectEnabled()
}

func testDoubleSlashKeepAutocorrectionEnabled() throws {
func disabled_testDoubleSlashKeepAutocorrectionEnabled() throws {
mockTrailingTyping("//")
assertAutoCorrectEnabled()
}

func testAutocorrectionIsReEnabled() throws {
func disabled_testAutocorrectionIsReEnabled() throws {
mockTrailingTyping("/")
assertAutocorrectDisabled()

Expand All @@ -58,7 +59,7 @@ extension WysiwygComposerViewModelTests {
assertAutoCorrectEnabled()
}

func testAutocorrectionAfterSetHtmlContent() {
func disabled_testAutocorrectionAfterSetHtmlContent() {
viewModel.setHtmlContent("/join #some_room:matrix.org")
assertAutocorrectDisabled()

Expand All @@ -79,7 +80,7 @@ extension WysiwygComposerViewModelTests {
// assertAutoCorrectEnabled()
// }

func testAutocorrectionAfterSetMarkdownContent() {
func disabled_testAutocorrectionAfterSetMarkdownContent() {
viewModel.setMarkdownContent("/join #some_room:matrix.org")
assertAutocorrectDisabled()

Expand Down

0 comments on commit 59fb5bd

Please sign in to comment.