DataTables / DataTables/Responsive

`not-` classes cannot be combined

Open
#55 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
151
Forks
91
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the combined not-* behavior in the linked JSFiddle, then inspect js/dataTables.responsive.js around line 425 where includeIn is assembled. Verify how multiple exclusions are handled and confirm that the completed change makes the Description column respond correctly when two or more not-* classes are combined.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.