@spectrum-web-components/accordion
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -6,2 +6,8 @@ # Change Log | ||
## [0.4.7](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/accordion@0.4.6...@spectrum-web-components/accordion@0.4.7) (2021-05-12) | ||
### Bug Fixes | ||
- ensure item exists when attempting to acquire next item to focus ([fb52cea](https://github.com/adobe/spectrum-web-components/commit/fb52ceac75f76943788411b206fd39739ff66a54)) | ||
## [0.4.6](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/accordion@0.4.5...@spectrum-web-components/accordion@0.4.6) (2021-04-15) | ||
@@ -8,0 +14,0 @@ |
{ | ||
"name": "@spectrum-web-components/accordion", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"publishConfig": { | ||
@@ -49,9 +49,9 @@ "access": "public" | ||
"@spectrum-web-components/base": "^0.4.3", | ||
"@spectrum-web-components/icon": "^0.9.5", | ||
"@spectrum-web-components/icons-ui": "^0.6.5", | ||
"@spectrum-web-components/shared": "^0.12.2", | ||
"@spectrum-web-components/icon": "^0.9.6", | ||
"@spectrum-web-components/icons-ui": "^0.6.6", | ||
"@spectrum-web-components/shared": "^0.12.3", | ||
"tslib": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@spectrum-css/accordion": "^3.0.1" | ||
"@spectrum-css/accordion": "^3.0.3" | ||
}, | ||
@@ -64,3 +64,3 @@ "types": "./src/index.d.ts", | ||
], | ||
"gitHead": "8acfee43ce3be5d4a6da4cf1179d3400bca77968" | ||
"gitHead": "50e608e54fbf56132aeed4433299fbcf7f6893ac" | ||
} |
@@ -82,13 +82,13 @@ /* | ||
let next = focused; | ||
let availableItems = items.length; | ||
let nextItem = items[next]; | ||
// cycle through the available items in the directions of the offset to find the next non-disabled item | ||
while ((items[next].disabled || next === focused) && availableItems) { | ||
availableItems -= 1; | ||
while (nextItem && (nextItem.disabled || next === focused)) { | ||
next = (items.length + next + direction) % items.length; | ||
nextItem = items[next]; | ||
} | ||
// if there are no non-disabled items, skip the work to focus a child | ||
if (items[next].disabled || next === focused) { | ||
if (!nextItem || nextItem.disabled || next === focused) { | ||
return; | ||
} | ||
items[next].focus(); | ||
nextItem.focus(); | ||
} | ||
@@ -95,0 +95,0 @@ onToggle(event) { |
@@ -105,13 +105,13 @@ /* | ||
let next = focused; | ||
let availableItems = items.length; | ||
let nextItem = items[next]; | ||
// cycle through the available items in the directions of the offset to find the next non-disabled item | ||
while ((items[next].disabled || next === focused) && availableItems) { | ||
availableItems -= 1; | ||
while (nextItem && (nextItem.disabled || next === focused)) { | ||
next = (items.length + next + direction) % items.length; | ||
nextItem = items[next]; | ||
} | ||
// if there are no non-disabled items, skip the work to focus a child | ||
if (items[next].disabled || next === focused) { | ||
if (!nextItem || nextItem.disabled || next === focused) { | ||
return; | ||
} | ||
items[next].focus(); | ||
nextItem.focus(); | ||
} | ||
@@ -118,0 +118,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128556