mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +00:00
Fix tab behavior on flat lists with no selected item
This commit is contained in:
parent
982b37fc13
commit
c7b9a62a41
1 changed files with 5 additions and 0 deletions
|
@ -651,6 +651,11 @@ export class List extends React.Component<IListProps, IListState> {
|
|||
// focused list item if it scrolls back into view.
|
||||
if (!focusWithin) {
|
||||
this.focusRow = -1
|
||||
} else if (this.props.selectedRows.length === 0) {
|
||||
const firstSelectableRowIndexPath = this.getFirstSelectableRowIndexPath()
|
||||
if (firstSelectableRowIndexPath !== null) {
|
||||
this.moveSelectionTo(firstSelectableRowIndexPath, { kind: 'focus' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue