Made sure an item in the timeline is selected when getting focus - Issue #558

This commit is contained in:
Maurice Parker 2019-03-03 15:51:52 -06:00
parent 08110044ea
commit 6fa019702d
2 changed files with 12 additions and 5 deletions

View File

@ -21,6 +21,16 @@ class TimelineTableView: NSTableView {
super.keyDown(with: event)
}
override func becomeFirstResponder() -> Bool {
if super.becomeFirstResponder() {
if selectedRow == -1 && numberOfRows > 0 {
rs_selectRowAndScrollToVisible(0)
}
return true
}
return false
}
// MARK: - NSView
override func viewWillStartLiveResize() {

View File

@ -375,9 +375,6 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
}
window.makeFirstResponderUnlessDescendantIsFirstResponder(tableView)
if !hasAtLeastOneSelectedArticle && articles.count > 0 {
tableView.rs_selectRowAndScrollToVisible(0)
}
}
// MARK: - Notifications