From 93b89ee754a918dfe0cf4b021987fc3f9868aba1 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 20 Aug 2024 18:07:10 +0530 Subject: [PATCH] Fix for CXTDT-597984, Fixing the padding issue while calculating the itemwidth which is causing the issue. --- VDS/Components/Table/TableFlowLayout.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VDS/Components/Table/TableFlowLayout.swift b/VDS/Components/Table/TableFlowLayout.swift index 2567f947..7af3621a 100644 --- a/VDS/Components/Table/TableFlowLayout.swift +++ b/VDS/Components/Table/TableFlowLayout.swift @@ -112,8 +112,7 @@ class MatrixFlowLayout : UICollectionViewFlowLayout { /// Fetches estimated height by calling the cell's component estimated height and adding padding private func estimateHeightFor(item: TableItemModel, with width: CGFloat, index: IndexPath) -> CGFloat { - let horizontalPadding = (index.row == 0 && !striped) ? (VDSLayout.space1X + layoutPadding.horizontalValue()) : (2 * layoutPadding.horizontalValue()) - let itemWidth = width - layoutPadding.horizontalValue() - defaultLeadingPadding + let itemWidth = width - layoutPadding.horizontalValue() - (index.row == 0 ? defaultLeadingPadding:layoutPadding.horizontalValue()) let maxSize = CGSize(width: itemWidth, height: CGFloat.greatestFiniteMagnitude) let estItemSize = item.component?.systemLayoutSizeFitting(maxSize, withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel) ?? CGSize(width: itemWidth, height: item.defaultHeight) return estItemSize.height + (2 * layoutPadding.verticalValue())