Skip to content

Commit

Permalink
Update: Remove _ariaLevel override property (fixes #142) (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirsty-hames authored Nov 13, 2023
1 parent eb0bd60 commit c6d405c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions templates/accordion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ export default function Accordion (props) {
const visited = Adapt.course.get('_globals')?._accessibility?._ariaLabels.visited;
const {
_id,
_ariaLevel,
onClick
} = props;
const itemAriaLevel = _.isNumber(_ariaLevel) && _ariaLevel !== 0 ? _ariaLevel + 1 : _ariaLevel;
return (
<div className="component__inner accordion__inner">

<templates.header {...props} />

<div className="component__widget accordion__widget">

{props._items.map(({ _graphic, _imageAlignment, _classes, title, body, _index, _isVisited, _isActive, _ariaLevel }, index) => {
{props._items.map(({ _graphic, _imageAlignment, _classes, title, body, _index, _isVisited, _isActive }, index) => {

const ariaLabel = `${_isVisited ? visited + '. ' : ''}${compile(title)}`;

Expand All @@ -36,7 +34,7 @@ export default function Accordion (props) {
data-index={_index}
>

<div role="heading" aria-level={a11y.ariaLevel({ id: _id, level: 'componentItem', override: _ariaLevel ?? itemAriaLevel })} >
<div role="heading" aria-level={a11y.ariaLevel({ id: _id, level: 'componentItem' })} >
<button
id={`${_id}-${index}-accordion-button`}
className={classes([
Expand Down

0 comments on commit c6d405c

Please sign in to comment.