From ea95897bbd7af6b6f991b301dcec3878b6b5d24c Mon Sep 17 00:00:00 2001 From: Mathieu Monney Date: Mon, 26 Oct 2015 15:37:02 +0100 Subject: [PATCH] Fixed: default selection of a CPTabView The selected tab item view is now loaded correctly after awakeFromCib, which wasn't the case before. --- AppKit/CPTabView.j | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index 12899624b..822619650 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -789,7 +789,13 @@ var CPTabViewItemsKey = "CPTabViewItemsKey", var idx = [self indexOfTabViewItem:_selectedTabViewItem]; if (idx !== CPNotFound) + { + // Temporarily set the selected item to not selected. + // It allows the initial selection to be made correctly. + _selectedTabViewItem = nil; + [self selectTabViewItemAtIndex:idx]; + } } var type = _type;