                     point = CGPoint(x: layout.frame.origin.x - collectionView.contentInset.left, y: collectionView.contentOffset.y)
                 }
                 collectionView.setContentOffset( point, animated: animated)
+            
                 CATransaction.setCompletionBlock({
                     if self.currentSelectedRow == nil || self.currentSelectedRow != indexPath.item {
                         self.currentSelectedRow = indexPath.item

        super.layoutSubviews()
        setupInsetForCollection()
        collectionView?.frame = CGRect(origin: CGPoint.zero, size: frame.size)
        highlitedViewFrameForDirection()
        if !initialized {
            initialized = true

extension FlatPickerView : UICollectionViewDelegateFlowLayout {
    public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        if direction == .horizontal {
            return CGSize(width: itemSize , height: self.frame.size.height )
        }
        return CGSize(width: self.frame.size.width , height: itemSize )
    }
    
    public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
