Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modules/*): filter out falsy elements #6823

Merged

Conversation

jordanrastrick
Copy link
Contributor

@jordanrastrick jordanrastrick commented Jul 7, 2023

N.B. I have not linked this PR to an issue because I can't provide my employer's application as a demo, and it would take vastly more time to strip it down to a working reproduction that I could get permission to share, than it would for the validity of the code fix to be assessed.

Under some circumstances when the the a11y module calls destroy() in response to receiving a destroy event, it throws an exception (which can't be easily handled due to the asynchronicity).

Screenshot 2023-07-07 at 2 58 47 pm

When the elements are retrieved from the swiper instance's navigation property:

let { nextEl, prevEl } = swiper.navigation ? swiper.navigation : {};

evidently they are arrays containing undefined.

The conservative change I have made and which I have validated fixes the problem is to extend the existing truthiness filter in makeElementsArray for the single element case to the case when the input is already an array.

@nolimits4web nolimits4web merged commit e1b7254 into nolimits4web:master Jul 25, 2023
@nolimits4web
Copy link
Owner

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants