-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat(data-table): indeterminate state in 'selectAll' checkbox (closes #571) #573
Conversation
when atleast one row is selected and not every row is selected, the checkbox for select/deselect all should be in indeterminate state.
@@ -303,6 +312,7 @@ export class TdDataTableComponent implements ControlValueAccessor, AfterContentI | |||
} else { | |||
this.clearModel(); | |||
} | |||
this._calculateCheckboxState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just set the this._allSelected here? You already looped through everything so you shouldn't need to do it again as you already know what the state should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true! ill change that real quick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated~
})(); | ||
}); | ||
|
||
it('should select one and be in indeterminate state, select all and then unselect all', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice unit test 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍷 🎩
UX is lovely, i'm ready to merge when i get signoff on the code |
when at least one row is selected and not every row is selected, the checkbox for select/deselect all should be in indeterminate state.
#571
What's included?
Test Steps
ng serve
data-table
demomultiple
/selectable
demoGeneral Tests for Every PR
ng serve --aot
still works.npm run lint
passes.npm test
passes and code coverage is not lower.npm run build
still works.Screenshots or link to CodePen/Plunker/JSfiddle