(selectedTabId: string, originalEvent?: Event)
| 903 | } |
| 904 | |
| 905 | _onItemSelect(selectedTabId: string, originalEvent?: Event) { |
| 906 | const selectedTabIndex = this._itemsFlat.findIndex(item => item.__id === selectedTabId); |
| 907 | const selectedTab = this._itemsFlat[selectedTabIndex] as Tab; |
| 908 | |
| 909 | const selectionSuccessful = this.selectTab(selectedTab, selectedTabIndex); |
| 910 | if (!selectionSuccessful) { |
| 911 | return; |
| 912 | } |
| 913 | |
| 914 | if (originalEvent) { |
| 915 | selectedTab.fireDecoratorEvent("click", { originalEvent }); |
| 916 | } |
| 917 | |
| 918 | // update selected property on all items |
| 919 | this._itemsFlat.forEach(item => { |
| 920 | if (!item.isSeparator) { |
| 921 | (item as Tab).selected = item === selectedTab; |
| 922 | } |
| 923 | }); |
| 924 | } |
| 925 | |
| 926 | /** |
| 927 | * Fires the `tab-select` event and changes the internal reference for the currently selected tab. |
no test coverage detected