       header.contentView.layoutIfNeeded()
       
       view.frame = detailViewFinalFrame
-      headerSnapshotView.frame = CGRect(x: 0, y: 0, width: cellFrame.width, height: cellFrame.height)
+      headerSnapshotView.frame = CGRect(x: 0, y: 0, width: cellFrame.width, height: height)
       tableViewSnapshotView.frame = CGRect(x: 0, y: header.frame.height, width: detailViewFinalFrame.width, height: cellsSize.height)
       tempView.frame = CGRect(x: 0, y: headerSnapshotView.frame.maxY, width: detailViewFinalFrame.width, height: detailViewFinalFrame.height)
     }) { (completed) in

      let view = context.view(forKey: detailViewKey), // actual view of `detail` view controller
      let rootTableView = root.tableView, // `tableView` of root view controller
      let detailTableView = detail.tableView, // `tableView` of detail view controller
      let path = root.expandedIndexPath, // `indexPath` of expanded cell
      let expandedCell = rootTableView.cellForRow(at: path) as? ElongationCell
    else { return }
    

    header.bottomViewTopConstraint.constant = appearance.topViewHeight
    header.bottomView.setNeedsLayout()
    
    let height = isExpanded ? cellFrame.height : appearance.topViewHeight + appearance.bottomViewHeight
    
    view.frame = CGRect(x: 0, y: cellFrame.minY, width: detailViewFinalFrame.width, height: cellFrame.height)
    headerSnapshotView.frame = CGRect(x: 0, y: cellFrame.minY, width: cellFrame.width, height: height)
    tableViewSnapshotView.frame = CGRect(x: 0, y: detailViewFinalFrame.maxY, width: cellsSize.width, height: cellsSize.height)
    tempView.frame = CGRect(x: 0, y: cellFrame.maxY, width: detailViewFinalFrame.width, height: 0)
    
