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

disabledClass breaks swiper when adding multiple classes #6344

Closed
5 of 6 tasks
benedictdudel opened this issue Feb 3, 2023 · 0 comments · Fixed by #6345
Closed
5 of 6 tasks

disabledClass breaks swiper when adding multiple classes #6344

benedictdudel opened this issue Feb 3, 2023 · 0 comments · Fixed by #6345
Labels

Comments

@benedictdudel
Copy link
Contributor

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-react-navigation-forked-95ip8x?file=%2Fsrc%2FApp.jsx&selection=%5B%7B%22endColumn%22%3A14%2C%22endLineNumber%22%3A17%2C%22startColumn%22%3A14%2C%22startLineNumber%22%3A17%7D%5D

Bug description

After upgrading to version 9 and adding multiple classes to disabledClass option, swiper crashed with the following error:

Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('foo bar') contains HTML space characters, which are not valid in tokens.
    at https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:4629:53
    at Array.forEach (<anonymous>)
    at toggleEl (https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:4627:8)
    at update (https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:4648:5)
    at Swiper.<anonymous> (https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:4711:7)
    at https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:734:24
    at Array.forEach (<anonymous>)
    at https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:733:38
    at Array.forEach (<anonymous>)
    at Swiper.emit (https://95ip8x-5173.preview.csb.app/node_modules/.vite/deps/chunk-DLJTEFBS.js?v=82aa8151:726:17)

Expected Behavior

No response

Actual Behavior

No response

Swiper version

9.0.0

Platform/Target and Browser Versions

All

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
benedictdudel added a commit to benedictdudel/swiper that referenced this issue Feb 3, 2023
benedictdudel added a commit to benedictdudel/swiper that referenced this issue Feb 3, 2023
benedictdudel added a commit to benedictdudel/swiper that referenced this issue Feb 3, 2023
Allow multiple classes in `disabledClass`, `navigationDisabledClass` and `lockClass`.

fixes nolimits4web#6344
nolimits4web pushed a commit that referenced this issue Feb 6, 2023
Allow multiple classes in `disabledClass`, `navigationDisabledClass` and `lockClass`.

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

Successfully merging a pull request may close this issue.

1 participant