mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
add |-textDidEndEditing:| override to ExtendedTableView like already existed
in ExtendedOutlineView so that it doesn't select another cell when inline editing is complete
This commit is contained in:
parent
0d27d0637f
commit
22252ef8a6
@ -217,7 +217,13 @@
|
||||
return [self menu];
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// -textDidEndEditing:
|
||||
//
|
||||
// Called when the object we're editing is done. The default behavior is to
|
||||
// select another editable item, but that's not the behavior we want. We just
|
||||
// want to keep the selection on what was being editing.
|
||||
//
|
||||
- (void)textDidEndEditing:(NSNotification *)aNotification
|
||||
{
|
||||
// Fake our own notification. We pretend that the editing was canceled due to a
|
||||
|
@ -94,4 +94,24 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// -textDidEndEditing:
|
||||
//
|
||||
// Called when the object we're editing is done. The default behavior is to
|
||||
// select another editable item, but that's not the behavior we want. We just
|
||||
// want to keep the selection on what was being editing.
|
||||
//
|
||||
- (void)textDidEndEditing:(NSNotification *)aNotification
|
||||
{
|
||||
// Fake our own notification. We pretend that the editing was canceled due to a
|
||||
// mouse click. This prevents outlineviw from selecting another cell for editing.
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSIllegalTextMovement] forKey:@"NSTextMovement"];
|
||||
NSNotification *fakeNotification = [NSNotification notificationWithName:[aNotification name] object:[aNotification object] userInfo:userInfo];
|
||||
|
||||
[super textDidEndEditing:fakeNotification];
|
||||
|
||||
// Make ourself first responder again
|
||||
[[self window] makeFirstResponder:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user