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: allow for multiple css class names, fixes #795 #797

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

tomqwpl
Copy link
Contributor

@tomqwpl tomqwpl commented Jun 28, 2023

The previous behaviour with jQuery was that anywhere a class name was passed, jQuery allowed a space separated list of class names.
With "classList.add" this behaviour has to be explicitly added.

I believe all cases where ".split()" is used are already guarded against the classname not being falsy.
There were a couple of places where ".split" was used, but not the spread operator (...). This would result in a comma separated list of classnames being added. The assumption is that was a bug so I have fixed those.

I haven't changed any code in "dist", I assume that is handled as part of the release process in some way.

The previous behaviour with jQuery was that anywhere a class
name was passed, jQuery allowed a space separated list of
class names.
With "classList.add" this behaviour has to be explicitly added.

I believe all cases where ".split()" is used are already guarded
against the classname not being falsy.
There were a couple of places where ".split" was used, but not
the spread operator (...). This would result in a comma separated
list of classnames being added. The assumption is that was a bug
so I have fixed those.

I haven't changed any code in "dist", I assume that is handled
as part of the release process in some way.
@tomqwpl
Copy link
Contributor Author

tomqwpl commented Jun 28, 2023

Note that currently the cypress tests don't seem to run cleanly.

@tomqwpl
Copy link
Contributor Author

tomqwpl commented Jun 28, 2023

OK. Cypress tests run cleanly now

Unclear whether this is a required part of the process
@tomqwpl
Copy link
Contributor Author

tomqwpl commented Jun 28, 2023

With these commits I can confirm that I can set a header button using a css class using code like:

cssClass: 'codicon codicon-refresh codicon-button header-cell-button refresh button',

@ghiscoding
Copy link
Collaborator

ghiscoding commented Jun 28, 2023

Thanks for the PR, the changes to the dist minified files wasn't necessary but that should still be fine. Thanks for the contribution.

EDIT

I also tested with our project and I don't see any problems, we can probably go ahead with the merge. Just remember to only change core file in the future, meaning that you don't need to modify any of the files that are in the dist/ folder since these files are updated whenever we do a release. Thanks

@ghiscoding ghiscoding changed the title fix: allow for multiple css class names (#795) fix: allow for multiple css class names, fixes #795 Jun 29, 2023
@ghiscoding
Copy link
Collaborator

I think it's safe to merge, so I'll go ahead and merge so that I can continue with other PRs

@ghiscoding ghiscoding merged commit ab644b4 into 6pac:master Jun 29, 2023
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.

2 participants