selection update

This commit is contained in:
Pfeil, Scott Robert 2021-07-20 13:47:08 -04:00
parent d244c38921
commit cfad9aae27

View File

@ -244,9 +244,13 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
return false
}) else { return }
// Refresh the cell.
// Refresh the cell. (reload loses cell selection)
let selectedIndex = tableView.indexPathForSelectedRow
let indexPath = IndexPath(row: index, section: 0)
tableView.reloadRows(at: [indexPath], with: .automatic)
if let selectedIndex = selectedIndex {
tableView.selectRow(at: selectedIndex, animated: false, scrollPosition: .none)
}
}
open override func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) {