From 1b7f684ab23e40c17fa59247c9591f649c2bb3b3 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Wed, 24 Jun 2015 21:14:24 +0200 Subject: [PATCH] make safari fix more robust --- AppKit/CPTextView/CPTextView.j | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 7d57ea99b..41db7b763 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -2153,13 +2153,6 @@ var _CPCopyPlaceholder = '-'; if (e.which == 8) // safari backspace fix _CPNativeInputFieldKeyPressedCalled = YES; - if(_CPNativeInputFieldActive && _CPNativeInputField.innerHTML.slice(-1) == ">") // exit when safari starts inserting tags - { - _CPNativeInputField.innerHTML='' - [self cancelCurrentNativeInputSession]; - return; - } - _CPNativeInputFieldKeyUpCalled = YES; var currentFirstResponder = [[CPApp mainWindow] firstResponder]; @@ -2181,6 +2174,9 @@ var _CPCopyPlaceholder = '-'; [currentFirstResponder _activateNativeInputElement:_CPNativeInputField]; } else { + if (_CPNativeInputField.innerHTML.length > 1) + _CPNativeInputField.innerHTML = ''; + if (_CPNativeInputFieldActive) [self _endInputSessionWithString:_CPNativeInputField.innerHTML];