From 2761be7991a1b0a42dc44d6a3c1ffab256ca9e73 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 10 Jun 2024 14:27:05 +0400 Subject: [PATCH] Various fixes --- .../Components/SheetComponent/Sources/SheetComponent.swift | 5 +++++ .../AuthorizationSequenceCountrySelectionController.swift | 2 +- .../BirthdayPickerScreen/Sources/BirthdayPickerScreen.swift | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/submodules/Components/SheetComponent/Sources/SheetComponent.swift b/submodules/Components/SheetComponent/Sources/SheetComponent.swift index b3bf62bc1e..73f260438a 100644 --- a/submodules/Components/SheetComponent/Sources/SheetComponent.swift +++ b/submodules/Components/SheetComponent/Sources/SheetComponent.swift @@ -63,6 +63,7 @@ public final class SheetComponent: Component { public let backgroundColor: BackgroundColor public let followContentSizeChanges: Bool public let clipsContent: Bool + public let isScrollEnabled: Bool public let externalState: ExternalState? public let animateOut: ActionSlot> public let onPan: () -> Void @@ -72,6 +73,7 @@ public final class SheetComponent: Component { backgroundColor: BackgroundColor, followContentSizeChanges: Bool = false, clipsContent: Bool = false, + isScrollEnabled: Bool = true, externalState: ExternalState? = nil, animateOut: ActionSlot>, onPan: @escaping () -> Void = {} @@ -80,6 +82,7 @@ public final class SheetComponent: Component { self.backgroundColor = backgroundColor self.followContentSizeChanges = followContentSizeChanges self.clipsContent = clipsContent + self.isScrollEnabled = isScrollEnabled self.externalState = externalState self.animateOut = animateOut self.onPan = onPan @@ -389,6 +392,8 @@ public final class SheetComponent: Component { updateContentSize() } + self.scrollView.isScrollEnabled = component.isScrollEnabled + self.ignoreScrolling = false if let currentAvailableSize = self.currentAvailableSize, currentAvailableSize.height != availableSize.height { self.scrollView.contentOffset = CGPoint(x: 0.0, y: -(availableSize.height - contentSize.height)) diff --git a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift index b29c7353aa..186e7ded8c 100644 --- a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift +++ b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift @@ -21,7 +21,7 @@ private func loadCountryCodes() -> [Country] { } let delimiter = ";" - let endOfLine = "\n" + let endOfLine = "\r\n" var result: [Country] = [] var countriesByPrefix: [String: (Country, Country.CountryCode)] = [:] diff --git a/submodules/TelegramUI/Components/Settings/BirthdayPickerScreen/Sources/BirthdayPickerScreen.swift b/submodules/TelegramUI/Components/Settings/BirthdayPickerScreen/Sources/BirthdayPickerScreen.swift index cc7d1af946..ac5ec472d0 100644 --- a/submodules/TelegramUI/Components/Settings/BirthdayPickerScreen/Sources/BirthdayPickerScreen.swift +++ b/submodules/TelegramUI/Components/Settings/BirthdayPickerScreen/Sources/BirthdayPickerScreen.swift @@ -267,6 +267,7 @@ private final class BirthdayPickerScreenComponent: Component { } )), backgroundColor: .color(environment.theme.list.plainBackgroundColor), + isScrollEnabled: false, animateOut: self.sheetAnimateOut )), environment: {