mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 01:42:03 +00:00
Fixed with CPTokenField: quickly entered tokens would be ignored.
If the autocomplete state had not been set yet, tokens could not be finished using the token separator, return or tab. Instead the user typed text remained in its 'non token' state.
This commit is contained in:
1 parent
07966bb7fe
commit
15af54efda
1 file changed
+3
-3
@@ -172,19 +172,19 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
|
||||
- (void)_autocompleteWithDOMEvent:(JSObject)DOMEvent
|
||||
{
|
||||
if (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting])
|
||||
if (![self _inputElement].value && (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting]))
|
||||
return;
|
||||
|
||||
[self _hideCompletions];
|
||||
|
||||
var token = _cachedCompletions[[_autocompleteView selectedRow]],
|
||||
var token = _cachedCompletions ? _cachedCompletions[[_autocompleteView selectedRow]] : nil,
|
||||
shouldRemoveLastObject = token !== @"" && [self _inputElement].value !== @"";
|
||||
|
||||
if (!token)
|
||||
token = [self _inputElement].value;
|
||||
|
||||
// Make sure the user typed an actual token to prevent the previous token from being emptied
|
||||
// If the input area is empty, we want to fallback to the normal behavior, resigning first
|
||||
// If the input area is empty, we want to fall back to the normal behavior, resigning first
|
||||
// responder or selecting the next or previous key view.
|
||||
if (!token || token === @"")
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user