Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Don't make any changes on focus out event in autocomplete inputs (mac)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Aug 22, 2018
1 parent 9df3dc9 commit 14c43b8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
8 changes: 0 additions & 8 deletions src/ui/osx/TogglDesktop/TimeEntryEditViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,6 @@ - (IBAction)descriptionAutoCompleteChanged:(id)sender
}

NSAssert(self.timeEntry != nil, @"Time entry expected");

NSString *key = [self.descriptionAutoCompleteInput stringValue];
AutocompleteItem *autocomplete = [self.liteDescriptionAutocompleteDataSource get:key];
[self updateWithSelectedDescription:autocomplete withKey:key];
}

- (void)updateWithSelectedDescription:(AutocompleteItem *)autocomplete withKey:(NSString *)key
Expand Down Expand Up @@ -952,10 +948,6 @@ - (IBAction)projectAutoCompleteChanged:(id)sender
}

NSAssert(self.timeEntry != nil, @"Expected time entry");

NSString *key = self.projectAutoCompleteInput.stringValue;
AutocompleteItem *autocomplete = [self.liteProjectAutocompleteDataSource get:key];
[self updateWithSelectedProject:autocomplete withKey:key];
}

- (void)updateWithSelectedProject:(AutocompleteItem *)autocomplete withKey:(NSString *)key
Expand Down
11 changes: 1 addition & 10 deletions src/ui/osx/TogglDesktop/TimerEditViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,8 @@ - (IBAction)autoCompleteChanged:(id)sender
{
return;
}
NSString *key = [self.autoCompleteInput stringValue];
AutocompleteItem *item = [self.liteAutocompleteDataSource get:key];

// User has entered free text
if (item == nil || item.Type < 0)
{
self.time_entry.Description = [self.autoCompleteInput stringValue];
return;
}

[self fillEntryFromAutoComplete:item];
self.time_entry.Description = [self.autoCompleteInput stringValue];
}

- (void)fillEntryFromAutoComplete:(AutocompleteItem *)item
Expand Down

0 comments on commit 14c43b8

Please sign in to comment.