From 3a6df5e0d428f125b3b5164e196f8d8644e861da Mon Sep 17 00:00:00 2001 From: Gowtham Ravipati Date: Sat, 19 Jun 2021 23:02:53 +0530 Subject: [PATCH 1/2] Made it in such a way that it updated and add the aria attributes to the elements as per their status --- assets/js/shared-ui/side-tabs.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/js/shared-ui/side-tabs.js b/assets/js/shared-ui/side-tabs.js index 73101419..26b9c564 100644 --- a/assets/js/shared-ui/side-tabs.js +++ b/assets/js/shared-ui/side-tabs.js @@ -19,19 +19,28 @@ newContent ; + $this.on('load', function(){ + $alllabels.attr( 'aria-selected',false ); + $alllabels.first.prop( 'aria-selected',true ); + $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).prop( 'aria-selected',false ); + $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).first.prop( 'aria-selected',true ); + }) $this.on( 'click', function( e ) { $alllabels.removeClass( 'active' ); $allinputs.removeProp( 'checked' ); - $wrapper.find( '> .sui-tabs-content > div[data-tab-content]' ).removeClass( 'active' ); + $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).removeClass( 'active' ); + $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).prop( 'aria-selected',false ); $label.addClass( 'active' ); $this.prop( 'checked', true ); - + $label.prop( 'aria-selected',true ); + newContent = $wrapper.find( '.sui-tabs-content div[data-tab-content="' + $data + '"]' ); if ( newContent.length ) { newContent.addClass( 'active' ); + newContent.prop( 'aria-selected',true ); } }); @@ -41,4 +50,4 @@ SUI.sideTabs( this ); }); -}( jQuery ) ); +}( jQuery ) ); \ No newline at end of file From f84050633fc9473042a0e42850a81b30c5c7b08e Mon Sep 17 00:00:00 2001 From: Gowtham Ravipati Date: Thu, 24 Jun 2021 22:59:21 +0530 Subject: [PATCH 2/2] corrected selector --- assets/js/shared-ui/side-tabs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/shared-ui/side-tabs.js b/assets/js/shared-ui/side-tabs.js index 26b9c564..888e9f23 100644 --- a/assets/js/shared-ui/side-tabs.js +++ b/assets/js/shared-ui/side-tabs.js @@ -22,15 +22,15 @@ $this.on('load', function(){ $alllabels.attr( 'aria-selected',false ); $alllabels.first.prop( 'aria-selected',true ); - $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).prop( 'aria-selected',false ); - $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).first.prop( 'aria-selected',true ); + $wrapper.find( '> .sui-tabs-content > div[data-tab-content]' ).prop( 'aria-selected',false ); + $wrapper.find( '> .sui-tabs-content > div[data-tab-content]' ).first.prop( 'aria-selected',true ); }) $this.on( 'click', function( e ) { $alllabels.removeClass( 'active' ); $allinputs.removeProp( 'checked' ); - $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).removeClass( 'active' ); - $wrapper.find( '.sui-tabs-content>div[data-tab-content]' ).prop( 'aria-selected',false ); + $wrapper.find( '> .sui-tabs-content > div[data-tab-content]' ).removeClass( 'active' ); + $wrapper.find( '> .sui-tabs-content > div[data-tab-content]' ).prop( 'aria-selected',false ); $label.addClass( 'active' ); $this.prop( 'checked', true );