Skip to content
Permalink
Browse files
Partially fix issue #3294 - allow users to deselect all rows by ESC w…
…hen more than one row is selected
  • Loading branch information
Kaspik committed Feb 20, 2019
1 parent 37f6283 commit 77d58ece24f61e7a5ed004d8d9b8b3796d92c004
Showing with 11 additions and 3 deletions.
  1. +11 −3 Source/SPTableView.m
@@ -246,9 +246,17 @@ - (void)keyDown:(NSEvent *)theEvent
}
}

// Check if ESCAPE is hit and use it to cancel row editing if supported
else if ([theEvent keyCode] == 53 && [[self delegate] respondsToSelector:@selector(cancelRowEditing)]) {
if ([(id<SPTableViewDelegate>)[self delegate] cancelRowEditing]) return;
// Check if ESCAPE is hit
else if ([theEvent keyCode] == 53) {
// Use it to cancel row editing if supported
if ([[self delegate] respondsToSelector:@selector(cancelRowEditing)]) {
if ([(id<SPTableViewDelegate>)[self delegate] cancelRowEditing]) return;
}
// If more rows is selected, cancel selection of all
else if ([self numberOfSelectedRows] > 1) {
[self deselectAll:nil];
}
return;
}

// If the Tab key is used, but tab editing is disabled, change focus rather than entering edit mode.

1 comment on commit 77d58ec

@dmoagx

This comment has been minimized.

Copy link
Member

@dmoagx dmoagx commented on 77d58ec Feb 20, 2019

Why should ESC clear the selection?
Where else is it implemented like that in the OS?

Please sign in to comment.