Skip to content

Commit 3aa2d75

Browse files
authored
Fix: Added is-highlighted class (#187)
1 parent f3eb826 commit 3aa2d75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

templates/gmcq.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function Gmcq(props) {
2323
body,
2424
instruction,
2525
ariaQuestion,
26-
onKeyPress,
26+
onKeyDown,
2727
onItemSelect,
2828
onItemFocus,
2929
onItemBlur
@@ -53,7 +53,7 @@ export default function Gmcq(props) {
5353
aria-label={ariaQuestion || null}
5454
>
5555

56-
{props._items.map(({ text, altText, _index, _isActive, _shouldBeSelected, _graphic }, index) =>
56+
{props._items.map(({ text, altText, _index, _isActive, _isHighlighted, _shouldBeSelected, _graphic }, index) =>
5757

5858
<div
5959
className={classes([
@@ -79,7 +79,7 @@ export default function Gmcq(props) {
7979
`${a11y.normalize(altText || text)} ${_graphic?.alt || ''}` :
8080
`${_shouldBeSelected ? ariaLabels.correct : ariaLabels.incorrect}, ${_isActive ? ariaLabels.selectedAnswer : ariaLabels.unselectedAnswer}. ${a11y.normalize(altText || text)} ${_graphic?.alt || ''}`}
8181
data-adapt-index={_index}
82-
onKeyPress={onKeyPress}
82+
onKeyDown={onKeyDown}
8383
onChange={onItemSelect}
8484
onFocus={onItemFocus}
8585
onBlur={onItemBlur}
@@ -91,6 +91,7 @@ export default function Gmcq(props) {
9191
'js-item-label',
9292
'u-no-select',
9393
!_isEnabled && 'is-disabled',
94+
_isHighlighted && 'is-highlighted',
9495
(_isCorrectAnswerShown ? _shouldBeSelected : _isActive) && 'is-selected'
9596
])}
9697
aria-hidden={true}

0 commit comments

Comments
 (0)