Skip to content

Commit 1924d95

Browse files
authored
Merge pull request #2576 from bigcommerce/SD-11413
fix(storefront): Fix the keyboard navigation on the swatch options
2 parents ddda13e + e711f98 commit 1924d95

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## Draft
88

99
- Update Cornerstone documentation url [#2575](https://github.com/bigcommerce/cornerstone/pull/2575)
10+
- Fix keyboard navigation on the swatch options [#2576](https://github.com/bigcommerce/cornerstone/pull/2576)
1011

1112
## 6.17.0 (10-01-2025)
1213
- Add net-new "order.pickup_addresses" to unify objects used on Order Details and Order Invoice pages [#2557](https://github.com/bigcommerce/cornerstone/pull/2557)

assets/js/theme/common/aria/radioOptions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const handleItemKeyDown = itemCollection => e => {
3535
case ariaKeyCodes.LEFT:
3636
case ariaKeyCodes.UP: {
3737
const prevItemIdx = calculateTargetItemPosition(lastCollectionItemIdx, itemIdx - 1);
38-
itemCollection.get(prevItemIdx).trigger('focus');
39-
setCheckedRadioItem(itemCollection, itemIdx - 1);
38+
itemCollection.eq(prevItemIdx).trigger('focus');
39+
setCheckedRadioItem(itemCollection, prevItemIdx);
4040
break;
4141
}
4242
case ariaKeyCodes.RIGHT:
4343
case ariaKeyCodes.DOWN: {
4444
const nextItemIdx = calculateTargetItemPosition(lastCollectionItemIdx, itemIdx + 1);
45-
itemCollection.get(nextItemIdx).trigger('focus');
46-
setCheckedRadioItem(itemCollection, itemIdx + 1);
45+
itemCollection.eq(nextItemIdx).trigger('focus');
46+
setCheckedRadioItem(itemCollection, nextItemIdx);
4747
break;
4848
}
4949

0 commit comments

Comments
 (0)