-
Notifications
You must be signed in to change notification settings - Fork 424
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
allow extra spaces in headerCssClass #960
allow extra spaces in headerCssClass #960
Conversation
Extra spaces in `class` dom attribute are allowed in html (e.g. `class="some-class other-class "`). SlickGrid should probably also behave the same way (or at least fail with some meaningfull validation error). This commit just ignores all extra spaces in headerCssClass (between individual classes or leading / trailing).
it seems like developers looking for trouble lol... I did some perf tests and this seems faster than // slick.core.ts Utils
function wordSplit(s = ''): string[] {
return s.split(' ').filter(cls => cls);
} then use it everywhere header.classList.add(...Utils.wordSplit(classname)); there's a few |
@jesenko Thanks the PR is looking good, but I just find the method name to be a little long, could we simply use |
… list Utils.classNameToClassList method is introduced to return list of css classes out of single space-separated className string.
edf87ab
to
a89f0bb
Compare
@ghiscoding renamed method to |
Shorter is better and we stayed concise so that's looking good now. Thanks for the contribution :) |
ohh I just noticed that your PR didn't include I had to do |
* fix: allow extra spaces in headerCssClass and other cssClass Extra spaces in `class` dom attribute are allowed in html (e.g. `class="some-class other-class "`). SlickGrid should probably also behave the same way (or at least fail with some meaningfull validation error). This commit just ignores all extra spaces in headerCssClass (between individual classes or leading / trailing).
Shipped with v5.7.1 release, thank you |
Extra spaces in
class
dom attribute are allowed in html (e.g.class="some-class other-class "
). SlickGrid should probably also behave the same way (or at least fail with some meaningfull validation error).This commit just ignores all extra spaces in headerCssClass (between individual classes or leading / trailing).
I did not add E2E test for this, seems a bit overkill to add example html file for testing such minor case...
The error can be reproduced however by e.g. adding some space at the beginning / end of
headerCssClass
inexamples/example-web-component-pubsub-esm.html:193