From 9e235f72369ad9be949b07e8d4f136cbf417c1ed Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 23 Oct 2010 20:21:02 -0300 Subject: [PATCH] Fixed: clicking tokens in a token field could disable its keyboard handling due to the input field losing focus. --- AppKit/CPTokenField.j | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTokenField.j b/AppKit/CPTokenField.j index c5f08a05a..877424ed1 100755 --- a/AppKit/CPTokenField.j +++ b/AppKit/CPTokenField.j @@ -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)