Skip to content

Commit

Permalink
chore: use addEventListener instead of addListener (#15923)
Browse files Browse the repository at this point in the history
Use addEventListener() instead of matchMedia().addListener() since matchMedia().addListener() is deprecated.
  • Loading branch information
amareshsm committed May 25, 2022
1 parent 5f5c1fb commit 10249ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/assets/js/components-index.js
Expand Up @@ -6,7 +6,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down
6 changes: 3 additions & 3 deletions docs/src/assets/js/main.js
Expand Up @@ -6,7 +6,7 @@

if (toc && matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down Expand Up @@ -53,7 +53,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down Expand Up @@ -93,7 +93,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down

0 comments on commit 10249ad

Please sign in to comment.