@internetstiftelsen/styleguide 3.0.10-beta.0.3 → 3.0.10-beta.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -122,6 +122,11 @@ window.a11yTabs = function tabsComponentIIFE(global, document) {
122
122
  this.tabPanels[currentIndex].setAttribute('hidden', '');
123
123
  this.tabPanels[newIndex].removeAttribute('hidden');
124
124
 
125
+ // After updating tabs and tab panels, add the URL update feature
126
+ // Update the browser's URL hash to reflect the current tab's ID
127
+ var selectedTabId = this.tabLinks[newIndex].id;
128
+ global.history.pushState(null, '', '#' + selectedTabId);
129
+
125
130
  this.currentIndex = newIndex;
126
131
 
127
132
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "3.0.10-beta.0.3",
3
+ "version": "3.0.10-beta.0.4",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -125,6 +125,11 @@ window.a11yTabs = (function tabsComponentIIFE(global, document) {
125
125
  this.tabPanels[currentIndex].setAttribute('hidden', '');
126
126
  this.tabPanels[newIndex].removeAttribute('hidden');
127
127
 
128
+ // After updating tabs and tab panels, add the URL update feature
129
+ // Update the browser's URL hash to reflect the current tab's ID
130
+ const selectedTabId = this.tabLinks[newIndex].id;
131
+ global.history.pushState(null, '', `#${selectedTabId}`);
132
+
128
133
  this.currentIndex = newIndex;
129
134
 
130
135
  return this;