We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Summary
When closing a cashmere tab and selecting a tab by the index an error occurs. TypeError: Cannot read properties of undefined (reading '_hideOverride')
Additional context File: healthcatalyst-cashmere.mjs line 19549.
Function: /** Sets the currently selected tab by either its numerical index or TabComponent object. * Passing a value of -1 or a hidden tab will deselect all tabs in the set. */ selectTab(tab, shouldEmit = true) { this._selectedTab = tab; const activeTab = typeof tab === 'number' ? this._tabs.toArray()[tab] : tab; if (tab === -1 || activeTab._hideOverride) { this.tabContent = null; if (this._routerEnabled) { this._routerDeselected = true; } this._tabs.toArray().forEach(t => t._active = false); if (shouldEmit) { this.selectedTabChange.emit(new TabChangeEvent(-1, null)); } } else { if (this._routerEnabled) { const routeArray = Array.isArray(activeTab.routerLink) ? activeTab.routerLink : [activeTab.routerLink]; this.router.navigate(routeArray, { relativeTo: this.route, queryParams: activeTab.queryParams }); } this._setActive(activeTab, shouldEmit); } }
/** Sets the currently selected tab by either its numerical index or
object. * Passing a value of -1 or a hidden tab will deselect all tabs in the set. */ selectTab(tab, shouldEmit = true) { this._selectedTab = tab; const activeTab = typeof tab === 'number' ? this._tabs.toArray()[tab] : tab; if (tab === -1 || activeTab._hideOverride) { this.tabContent = null; if (this._routerEnabled) { this._routerDeselected = true; } this._tabs.toArray().forEach(t => t._active = false); if (shouldEmit) { this.selectedTabChange.emit(new TabChangeEvent(-1, null)); } } else { if (this._routerEnabled) { const routeArray = Array.isArray(activeTab.routerLink) ? activeTab.routerLink : [activeTab.routerLink]; this.router.navigate(routeArray, { relativeTo: this.route, queryParams: activeTab.queryParams }); } this._setActive(activeTab, shouldEmit); } }
The error seems to be in this line: if (tab === -1 || activeTab._hideOverride) { activeTab is undefined.
if (tab === -1 || activeTab._hideOverride) {
Original call this.templateTabSet.selectTab(index, true)
this.templateTabSet.selectTab(index, true)
Suggested Fix Checking the activeTab object before using it or adding ? when calling the _hideOverride property.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
When closing a cashmere tab and selecting a tab by the index an error occurs.
TypeError: Cannot read properties of undefined (reading '_hideOverride')
Additional context
File:
healthcatalyst-cashmere.mjs line 19549.
Function:
/** Sets the currently selected tab by either its numerical index or
TabComponentobject. * Passing a value of -1 or a hidden tab will deselect all tabs in the set. */ selectTab(tab, shouldEmit = true) { this._selectedTab = tab; const activeTab = typeof tab === 'number' ? this._tabs.toArray()[tab] : tab; if (tab === -1 || activeTab._hideOverride) { this.tabContent = null; if (this._routerEnabled) { this._routerDeselected = true; } this._tabs.toArray().forEach(t => t._active = false); if (shouldEmit) { this.selectedTabChange.emit(new TabChangeEvent(-1, null)); } } else { if (this._routerEnabled) { const routeArray = Array.isArray(activeTab.routerLink) ? activeTab.routerLink : [activeTab.routerLink]; this.router.navigate(routeArray, { relativeTo: this.route, queryParams: activeTab.queryParams }); } this._setActive(activeTab, shouldEmit); } }
The error seems to be in this line:
if (tab === -1 || activeTab._hideOverride) {
activeTab is undefined.
Original call
this.templateTabSet.selectTab(index, true)
Suggested Fix
Checking the activeTab object before using it or adding ? when calling the _hideOverride property.
The text was updated successfully, but these errors were encountered: