Skip to content

Commit

Permalink
Fix: Added is-highlighted class (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Feb 4, 2025
1 parent f3eb826 commit 3aa2d75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/gmcq.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Gmcq(props) {
body,
instruction,
ariaQuestion,
onKeyPress,
onKeyDown,
onItemSelect,
onItemFocus,
onItemBlur
Expand Down Expand Up @@ -53,7 +53,7 @@ export default function Gmcq(props) {
aria-label={ariaQuestion || null}
>

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

<div
className={classes([
Expand All @@ -79,7 +79,7 @@ export default function Gmcq(props) {
`${a11y.normalize(altText || text)} ${_graphic?.alt || ''}` :
`${_shouldBeSelected ? ariaLabels.correct : ariaLabels.incorrect}, ${_isActive ? ariaLabels.selectedAnswer : ariaLabels.unselectedAnswer}. ${a11y.normalize(altText || text)} ${_graphic?.alt || ''}`}
data-adapt-index={_index}
onKeyPress={onKeyPress}
onKeyDown={onKeyDown}
onChange={onItemSelect}
onFocus={onItemFocus}
onBlur={onItemBlur}
Expand All @@ -91,6 +91,7 @@ export default function Gmcq(props) {
'js-item-label',
'u-no-select',
!_isEnabled && 'is-disabled',
_isHighlighted && 'is-highlighted',
(_isCorrectAnswerShown ? _shouldBeSelected : _isActive) && 'is-selected'
])}
aria-hidden={true}
Expand Down

0 comments on commit 3aa2d75

Please sign in to comment.