Skip to content

Commit

Permalink
fix: case where component resets while toggle is enqueued
Browse files Browse the repository at this point in the history
  • Loading branch information
janschoenherr committed May 27, 2022
1 parent fe32fe2 commit 03cf1f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/core/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export default {
toggle(el, inview) {
const state = this._data.elements.get(el);

if (!state) {
return;
}

state.off?.();

css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
Expand Down

0 comments on commit 03cf1f0

Please sign in to comment.