Skip to content

Comments

Fix bug where using an array when calling (add/remove)_css_class didn…#232

Merged
leastbad merged 2 commits intostimulusreflex:masterfrom
binarygit:bugfix-for-add/remove_css_class-when-using-array
Dec 28, 2022
Merged

Fix bug where using an array when calling (add/remove)_css_class didn…#232
leastbad merged 2 commits intostimulusreflex:masterfrom
binarygit:bugfix-for-add/remove_css_class-when-using-array

Conversation

@binarygit
Copy link
Contributor

@binarygit binarygit commented Dec 18, 2022

Type of PR (feature, enhancement, bug fix, etc.)

This is a bugfix for #231 , while the original issue only mentions add_css_class while working on this, I realized that the same bug affected remove_css_class and so fixed that too.

Description

Please include a summary of the change and which issue is fixed.

Fixes #231

Why should this be added

It fixes a bug.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

Please note that the best way to suggest changes or updates to the documentation is to join Discord and leave a note in the #docs channel. Any documentation updates posted as PRs cannot be accepted at this time. ❤️

@leastbad leastbad added this to the 5.0 milestone Dec 18, 2022
@leastbad leastbad added bug javascript Pull requests that update Javascript code labels Dec 18, 2022
Copy link
Contributor

@leastbad leastbad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this.

I added a quick check to remove the class attribute if there are no classes defined.

@leastbad leastbad merged commit c3da1ff into stimulusreflex:master Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using an array with addCssClass does not update the classList correctly

2 participants