mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +00:00
Merge pull request #17345 from desktop/fix-tab-flat-list
Fix tab behavior on flat lists with no selected item
This commit is contained in:
commit
2fef5ba055
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