Skip to content

Commit

Permalink
Scroll to selected annotation in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Nov 7, 2024
1 parent 98ba0ce commit 8215fcd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ class HtmlEpubSidebarViewController: UIViewController {
)
}

if let key = state.focusSidebarKey, let indexPath = dataSource.indexPath(for: key) {
let isVisible = parentDelegate?.isSidebarVisible ?? false
tableView.selectRow(at: indexPath, animated: isVisible, scrollPosition: .middle)
}

if state.changes.contains(.sidebarEditingSelection) {
deleteBarButton?.isEnabled = state.deletionEnabled
}
Expand Down

0 comments on commit 8215fcd

Please sign in to comment.