We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ef2597 commit fdf25d1Copy full SHA for fdf25d1
src/block/tabs/frontend-tabs.js
@@ -127,6 +127,14 @@ class _StackableTabs {
127
} )
128
129
this.activeTab = tabIndex
130
+
131
+ // Dispatch an event when the tab is changed
132
+ this.parentEl.dispatchEvent( new CustomEvent( 'stackable-tabs-change', {
133
+ detail: {
134
+ element: this.parentEl,
135
+ activeTab: tabIndex,
136
+ },
137
+ } ) )
138
}
139
140
initWindowEventListeners = () => {
@@ -157,7 +165,8 @@ class StackableTabs {
157
165
document.querySelectorAll( '.stk-block-tabs' )
158
166
.forEach( el => {
159
167
if ( ! el._StackableHasInitTabs ) {
160
- new _StackableTabs( el )
168
+ const tabs = new _StackableTabs( el )
169
+ el.tabs = tabs
161
170
el._StackableHasInitTabs = true
162
171
163
172
0 commit comments