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

not- classes cannot be combined #55

Open
Philzen opened this issue Nov 2, 2015 · 1 comment
Open

not- classes cannot be combined #55

Philzen opened this issue Nov 2, 2015 · 1 comment

Comments

@Philzen
Copy link

Philzen commented Nov 2, 2015

Fiddle

Studying the documentation for responsive class logic and also from several use cases i had the assumption that classes are freely combinable. For example, in the fiddle the "Company Name" field will always be shown within tablet and mobile breakpoints by adding mobile tablet in the class attribute.

When using not-*, it turns out the functionality breaks when trying to combine them. As you can try out in the fiddle, removing one of the two on the "Description" class-Attribute will work as expected, using two or more not--classes makes the column behave as if all was set.

This behaviour is inline with my understanding what happens around this area - basically one cancels out the other:

https://github.com/DataTables/Responsive/blob/master/js/dataTables.responsive.js#L425

imho (as this is also a reversed logic) this could be changed to be subtractive, rather than adding all other breakpoints to the includeIn array.

@DataTables
Copy link
Collaborator

Very good point - this should work, and that it doesn't is absolutely a bug.

I'm not immediately certain what the fix should be - as you point out the rest of the logic is additive, and mixing that the subtractive logic that should be used for the not-* case might be a little messy.

I'll get back to you on this one when I get a chance to look at it a bit closer. Unfortunately it won't be included in the next release of Responsive (since that should be tomorrow).

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

No branches or pull requests

1 participant