From 0b47d70352912b61b433ae44fe93841f63a8c210 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Mon, 24 Jun 2024 17:04:36 +0530 Subject: [PATCH] Digital ACT-191 ONEAPP-7013 story: changes to the default view of the carousel with one peek visible --- VDS/Components/Carousel/Carousel.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VDS/Components/Carousel/Carousel.swift b/VDS/Components/Carousel/Carousel.swift index 6c091ce2..378289c7 100644 --- a/VDS/Components/Carousel/Carousel.swift +++ b/VDS/Components/Carousel/Carousel.swift @@ -441,7 +441,13 @@ open class Carousel: View { minimumSlotWidth = actualWidth - (CGFloat(layout.value) * gutter.value) switch peek { case .standard: - minimumSlotWidth = minimumSlotWidth - (3*peekMinimum) + // Supported for all Tablet viewports and layouts. + // Supported only for 1up layouts on Mobile viewports. + if UIDevice.isIPad { + minimumSlotWidth = minimumSlotWidth - (minimumSlotWidth/(CGFloat(layout.value) + 2)) + } else if layout == .oneUP { + minimumSlotWidth = minimumSlotWidth - (minimumSlotWidth/4) + } case .minimum: minimumSlotWidth = minimumSlotWidth - peekMinimum case .none: