-
Notifications
You must be signed in to change notification settings - Fork 474
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(addon-table): fix sorting on table with dynamic columns #6103
Conversation
Pull request was closed ✔️All saved screenshots (for current PR) were deleted 🗑️ |
projects/addon-table/components/table/directives/sortable.directive.ts
Outdated
Show resolved
Hide resolved
Visit the preview URL for this PR (updated for commit f621ced): https://taiga-ui--pr6103-table-dynamic-sort-zz06d87b.web.app (expires Thu, 30 Nov 2023 14:56:50 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4b5ece1e114386f6a105425ef799091475b249eb |
BundleMonFiles updated (2)
Unchanged files (3)
Total files change -641B -0.1% Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6103 +/- ##
===========================================
- Coverage 71.95% 60.37% -11.58%
===========================================
Files 1462 46 -1416
Lines 15975 477 -15498
Branches 2269 29 -2240
===========================================
- Hits 11495 288 -11207
+ Misses 4109 184 -3925
+ Partials 371 5 -366
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
projects/addon-table/components/table/directives/sortable.directive.ts
Outdated
Show resolved
Hide resolved
@@ -52,6 +53,9 @@ export class TuiThComponent<T extends Partial<Record<keyof T, any>>> { | |||
@Optional() | |||
@Inject(forwardRef(() => TuiTableDirective)) | |||
readonly table: TuiTableDirective<T> | null, | |||
@Optional() | |||
@Inject(forwardRef(() => TuiSortByDirective)) | |||
private readonly sortBy: TuiSortByDirective<T> | null, |
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.
SortBy directive is kind of an extension over the regular table API to allow sorting by key, baseline table should not depend on it.
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.
Ok, I returned Th
👍
now I tried to invert the flow a little: we can call check
and update parent table directive from TuiSortByDirective
setter, instead of relying on ngDoCheck
PR Type
What kind of change does this PR introduce?
What is the current behaviour?
Closes #6070
What is the new behaviour?