diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/BaseDropdownEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/BaseDropdownEntryField.swift index 5a7f1702..d9b42a41 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/BaseDropdownEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/BaseDropdownEntryField.swift @@ -88,14 +88,18 @@ import UIKit } @objc public override func dismissFieldInput(_ sender: Any?) { - performDropdownAction() + if !textField.isFirstResponder { + performDropdownAction() + } super.dismissFieldInput(sender) } func performDropdownAction() { - if let baseDropdownEntryFieldModel = baseDropdownEntryFieldModel, let actionModel = baseDropdownEntryFieldModel.action { - let additionalDataWithSource = additionalData.dictionaryAdding(key: KeySourceModel, value: baseDropdownEntryFieldModel) - MVMCoreActionHandler.shared()?.asyncHandleAction(with: actionModel, additionalData: additionalDataWithSource, delegateObject: delegateObject) - } + guard let baseDropdownEntryFieldModel = baseDropdownEntryFieldModel, + let actionModel = baseDropdownEntryFieldModel.action + else { return } + + let additionalDataWithSource = additionalData.dictionaryAdding(key: KeySourceModel, value: baseDropdownEntryFieldModel) + MVMCoreActionHandler.shared()?.asyncHandleAction(with: actionModel, additionalData: additionalDataWithSource, delegateObject: delegateObject) } } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 8a1f960b..975c7ebb 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -234,7 +234,6 @@ open class BarsIndicatorView: CarouselIndicator { super.reset() barReferences.forEach { $0.removeFromSuperview() } barReferences = [] - currentIndex = 0 } public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index 5b04d065..6a82ef80 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -248,10 +248,4 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { bottomConstraint?.constant = constant topConstraint?.constant = constant } - - open override func reset() { - super.reset() - currentIndex = 0 - previousIndex = 0 - } } diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 102bec40..9b1d7b54 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -41,7 +41,7 @@ open class Carousel: View { open var numberOfPages = 0 /// The models for the molecules. - public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]? + public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]? /// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%. public var itemAlignment = UICollectionView.ScrollPosition.left @@ -177,7 +177,6 @@ open class Carousel: View { if let selectedIndex = carouselModel.selectedIndex { let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: []) - goTo(adjustedIndex, animated: false) } } @@ -213,7 +212,7 @@ open class Carousel: View { pagingView?.reset() collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) } - + var pagingMoleculeName: String? /// Sets up the paging molecule diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift index df258324..8721db72 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/CarouselModel.swift @@ -20,7 +20,7 @@ import UIKit } public var backgroundColor: Color? - public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol] + public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol] public var index: Int = 0 public var spacing: CGFloat? public var border: Bool? @@ -41,7 +41,7 @@ import UIKit public var selectable = false public var selectedIndex: Int? - public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]) { + public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]) { self.molecules = molecules } diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 20f0d227..d8639b56 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -1053,7 +1053,11 @@ CGFloat const PanelAnimationDuration = 0.2; } + (CGFloat)getApplicationViewWidth { - return CGRectGetWidth([self getBounds:[MVMCoreUISession sharedGlobal].splitViewController.view.superview]); + __block CGFloat width; + [MVMCoreDispatchUtility performSyncBlockOnMainThread:^{ + width = CGRectGetWidth([self getBounds:[MVMCoreUISession sharedGlobal].splitViewController.view.superview]); + }]; + return width; } + (CGFloat)getApplicationViewMaxSize { diff --git a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift index 9ccd1d25..50236e45 100644 --- a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift +++ b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift @@ -270,7 +270,9 @@ import UIKit bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size) if updateMoleculeLayout || heightChanged { - delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) + DispatchQueue.main.async { [self] in + delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) + } } setNeedsDisplay()