diff --git a/includes/TabberTransclude.php b/includes/TabberTransclude.php index 9f1e400..22c60a7 100644 --- a/includes/TabberTransclude.php +++ b/includes/TabberTransclude.php @@ -126,7 +126,7 @@ class TabberTransclude { */ private static function getTabHTML( array $tabData ): string { $tabpanelId = "tabber-tabpanel-{$tabData['id']}"; - return Html::rawElement( 'a', [ + return Html::element( 'a', [ 'class' => 'tabber__tab', 'id' => "tabber-tab-{$tabData['id']}", 'href' => "#$tabpanelId", diff --git a/modules/ext.tabberNeue/Transclude.js b/modules/ext.tabberNeue/Transclude.js index 8fd5d4f..e222921 100644 --- a/modules/ext.tabberNeue/Transclude.js +++ b/modules/ext.tabberNeue/Transclude.js @@ -58,17 +58,18 @@ class Transclude { credentials: 'same-origin', signal: controller.signal } ); - clearTimeout( timeoutId ); if ( !response.ok ) { throw new Error( `[TabberNeue] Network response was not ok: ${ response.status } - ${ response.statusText }` ); } - return Promise.resolve( response.text() ); + return response.text(); } catch ( error ) { if ( error.name === 'AbortError' ) { return Promise.reject( new Error( '[TabberNeue] Request timed out after 5000ms' ) ); } else { return Promise.reject( new Error( `[TabberNeue] Error fetching data from URL: ${ this.url } - ${ error }` ) ); } + } finally { + clearTimeout( timeoutId ); } } diff --git a/modules/ext.tabberNeue/ext.tabberNeue.js b/modules/ext.tabberNeue/ext.tabberNeue.js index 33b131e..116d5a9 100644 --- a/modules/ext.tabberNeue/ext.tabberNeue.js +++ b/modules/ext.tabberNeue/ext.tabberNeue.js @@ -406,7 +406,7 @@ class TabberBuilder { setTabsAttributes() { const tabAttributes = { tabindex: '-1', - 'aria-selected': false + 'aria-selected': 'false' }; for ( const tab of this.tablist.children ) { Util.setAttributes( tab, tabAttributes ); @@ -457,7 +457,6 @@ class TabberBuilder { tabberEvent.init(); this.tabber.classList.remove( 'tabber--init' ); this.tabber.classList.add( 'tabber--live' ); - TabberAction.setActiveTab( activeTab ); } }