Fixed: clicking tokens in a token field could disable its keyboard handling due to the input field losing focus.

This commit is contained in:
Alexander Ljungberg committed 2010-10-23 20:21:02 -03:00
1 parent 90d12ef77e
commit 9e235f7236
1 file changed
+4 -1
+4 -1
View File
@@ -992,8 +992,11 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// Hide the editor if there are selected tokens, but still keep it active
// so we can continue using our standard keyboard handling events.
if (_selectedRange.length)
if (isEditing && _selectedRange.length)
{
[self _inputElement].style.left = "-10000px";
[self _inputElement].focus();
}
// Trim off any excess height downwards.
if (CGRectGetHeight([contentView bounds]) > offset.y + tokenHeight)