selection update
This commit is contained in:
parent
d244c38921
commit
cfad9aae27
@ -244,9 +244,13 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
return false
|
return false
|
||||||
}) else { return }
|
}) else { return }
|
||||||
|
|
||||||
// Refresh the cell.
|
// Refresh the cell. (reload loses cell selection)
|
||||||
|
let selectedIndex = tableView.indexPathForSelectedRow
|
||||||
let indexPath = IndexPath(row: index, section: 0)
|
let indexPath = IndexPath(row: index, section: 0)
|
||||||
tableView.reloadRows(at: [indexPath], with: .automatic)
|
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) {
|
open override func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user