Socket
Socket
Sign inDemoInstall

@github/tab-container-element

Package Overview
Dependencies
Maintainers
14
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/tab-container-element - npm Package Compare versions

Comparing version 3.0.8 to 3.0.9

23

dist/index.esm.js

@@ -37,2 +37,18 @@ export default class TabContainerElement extends HTMLElement {

connectedCallback() {
for (const tab of this.querySelectorAll('[role="tablist"] [role="tab"]')) {
if (!tab.hasAttribute('aria-selected')) {
tab.setAttribute('aria-selected', 'false');
}
if (!tab.hasAttribute('tabindex')) {
if (tab.getAttribute('aria-selected') === 'true') {
tab.setAttribute('tabindex', '0');
} else {
tab.setAttribute('tabindex', '-1');
}
}
}
}
}

@@ -61,7 +77,10 @@

panel.hidden = true;
panel.setAttribute('tabindex', '0');
if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {
panel.setAttribute('tabindex', '0');
}
}
selectedTab.setAttribute('aria-selected', 'true');
selectedTab.removeAttribute('tabindex');
selectedTab.setAttribute('tabindex', '0');
selectedTab.focus();

@@ -68,0 +87,0 @@ selectedPanel.hidden = false;

@@ -13,3 +13,3 @@ (function (global, factory) {

}
})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) {
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
"use strict";

@@ -58,2 +58,18 @@

connectedCallback() {
for (const tab of this.querySelectorAll('[role="tablist"] [role="tab"]')) {
if (!tab.hasAttribute('aria-selected')) {
tab.setAttribute('aria-selected', 'false');
}
if (!tab.hasAttribute('tabindex')) {
if (tab.getAttribute('aria-selected') === 'true') {
tab.setAttribute('tabindex', '0');
} else {
tab.setAttribute('tabindex', '-1');
}
}
}
}
}

@@ -84,7 +100,10 @@

panel.hidden = true;
panel.setAttribute('tabindex', '0');
if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {
panel.setAttribute('tabindex', '0');
}
}
selectedTab.setAttribute('aria-selected', 'true');
selectedTab.removeAttribute('tabindex');
selectedTab.setAttribute('tabindex', '0');
selectedTab.focus();

@@ -91,0 +110,0 @@ selectedPanel.hidden = false;

16

package.json
{
"name": "@github/tab-container-element",
"version": "3.0.8",
"version": "3.0.9",
"description": "Tab container element",

@@ -27,10 +27,10 @@ "main": "dist/index.umd.js",

"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.0",
"@babel/plugin-transform-modules-umd": "^7.7.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/plugin-transform-modules-umd": "^7.8.3",
"babel-preset-github": "^3.2.1",
"chai": "^4.2.0",
"eslint": "^6.6.0",
"eslint-plugin-github": "^3.2.1",
"flow-bin": "^0.111.1",
"eslint": "^6.8.0",
"eslint-plugin-github": "^3.4.1",
"flow-bin": "^0.120.1",
"karma": "^4.4.1",

@@ -41,3 +41,3 @@ "karma-chai": "^0.1.0",

"karma-mocha-reporter": "^2.2.5",
"mocha": "^6.2.2"
"mocha": "^7.1.0"
},

@@ -44,0 +44,0 @@ "eslintIgnore": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc