From 1f53ff27d8345aa13fcdc963aee64370a825898d Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Tue, 10 Dec 2024 22:18:31 +0100 Subject: [PATCH] Eliminate underline blinks while typing if previous text ends with a link --- apple/MarkdownTextFieldObserver.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apple/MarkdownTextFieldObserver.mm b/apple/MarkdownTextFieldObserver.mm index 6bf0fb0f..dff905b4 100644 --- a/apple/MarkdownTextFieldObserver.mm +++ b/apple/MarkdownTextFieldObserver.mm @@ -41,7 +41,12 @@ - (void)textFieldDidChange:(__unused UITextField *)textField { _active = NO; // prevent recursion _textField.attributedText = attributedText; _active = YES; + + // Restore cursor position [_textField setSelectedTextRange:textRange notifyDelegate:NO]; + + // Eliminate underline blinks while typing if previous text ends with a link + _textField.typingAttributes = _textField.defaultTextAttributes; } - (void)textFieldDidEndEditing:(__unused UITextField *)textField