Skip to content

Commit

Permalink
mosaic lint error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anu13297 committed Feb 7, 2025
1 parent ebd9d4b commit 782d212
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eds/blocks/mosaic-reveal/mosaic-reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export default function decorate(block) {
};

[...block.children].forEach((child, idx) => {
var msrevealcontent = child.querySelector('.mosaic-reveal-content');
var h3 = msrevealcontent.querySelector('h3');

let msrevealcontent = child.querySelector('.mosaic-reveal-content');

Check failure on line 52 in eds/blocks/mosaic-reveal/mosaic-reveal.js

View workflow job for this annotation

GitHub Actions / build

'msrevealcontent' is never reassigned. Use 'const' instead
let mosaicTitle = msrevealcontent.querySelector('h3');

Check failure on line 53 in eds/blocks/mosaic-reveal/mosaic-reveal.js

View workflow job for this annotation

GitHub Actions / build

'mosaicTitle' is never reassigned. Use 'const' instead

Check failure on line 54 in eds/blocks/mosaic-reveal/mosaic-reveal.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
child.addEventListener('click', () => {
if (mediaQuery.matches) {
revealContent.setAttribute('aria-hidden', 'false');
Expand All @@ -63,17 +63,17 @@ export default function decorate(block) {
child.addEventListener('mouseenter', () => {
if (!mediaQuery.matches) {
child.querySelector('.mosaic-reveal-content').ariaHidden = false;
h3.setAttribute('tabindex', '0');
mosaicTitle.setAttribute('tabindex', '0');
setTimeout(() => {
h3.focus();
mosaicTitle.focus();
}, 100);
}
});

child.addEventListener('mouseleave', () => {
if (!mediaQuery.matches) {
child.querySelector('.mosaic-reveal-content').ariaHidden = true;
h3.setAttribute('tabindex', '-1');
mosaicTitle.setAttribute('tabindex', '-1');
}
});

Expand Down

0 comments on commit 782d212

Please sign in to comment.