diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 804075ff..c2df0909 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -244,7 +244,11 @@ extension Tabs: UICollectionViewDelegateFlowLayout { tabCell.setNeedsDisplay() tabCell.setNeedsLayout() tabCell.layoutIfNeeded() - delegate?.didSelectItem(indexPath, tabs: self) + if let delegate = delegate { + delegate.didSelectItem(indexPath, tabs: self) + } else if let action = tabsModel.tabs[selectedIndex].action { + MVMCoreActionHandler.shared()?.asyncHandleAction(with: action, additionalData: nil, delegateObject:delegateObject) + } } } diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index a636b90b..6d49cdfe 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -67,6 +67,9 @@ extension TabsTableViewCell: TabsDelegate { let index = indexPath.row guard let model = tabsListItemModel, index < model.molecules.count else { return } + if let action = model.tabs.tabs[index].action { + MVMCoreActionHandler.shared()?.asyncHandleAction(with: action, additionalData: nil, delegateObject:delegateObject) + } MVMCoreActionHandler.shared()?.asyncHandleAction(with: AddMoleculesActionModel(index < previousTabIndex ? .left : .right), additionalData: [KeySourceModel: model], delegateObject: delegateObject) } }