Skip to content

Commit

Permalink
Fix the condition in canFocusRowAt (#4)
Browse files Browse the repository at this point in the history
focusInside flips to false when fast scrolling mode activates so we need
to check isFastScrolling as well, otherwise, after fast scroll, the
table view might no longer accept focus
  • Loading branch information
pwszebor-vimn authored Sep 4, 2024
1 parent 1c65a1d commit 9080646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TVOSPicker/TVOSPickerComponentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ extension TVOSPickerComponentView: UITableViewDelegate {
}

func tableView(_ tableView: UITableView, canFocusRowAt indexPath: IndexPath) -> Bool {
if !focusInside, let selected = tableView.indexPathForSelectedRow {
if !focusInside, !isFastScrolling, let selected = tableView.indexPathForSelectedRow {
return indexPath == selected
}
return rangeOfAllowedIndices?.contains(indexPath.item) ?? true
Expand Down

0 comments on commit 9080646

Please sign in to comment.