angular / angular/components

[Sort] Implement API to clear sort

Open
#10,524 12 comments 10 reactions 0 assignees View on GitHub
area: material/sort feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
I would like to know if there is a provision available to clear the sorting set by user on a mat-table column dynamically.

#### What is the expected behavior?
Provision to clear sort order set by user on mat-table

#### What is the current behavior?
Once user applies sort on a particular column, it is maintained permanently.

#### What are the steps to reproduce?
Click on one column header of a mat-table with sorting implemented. The table will be sorted based on the column data. Now if we need to reset the sorting, we need to click on the same column header 2 more times.

#### What is the use-case or motivation for changing an existing behavior?
Our requirement is to reset the user selected sort order on every reload.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 1.7.3
Node: 8.9.4
OS: win32 x64
Angular: 5.2.9

#### Is there anything else we should know?

Contributor guide

Open the contributing guide

Research direction

Start at the mat-table sorting entry point and trace how the user-selected sort state is maintained. Define the clear-sorting API around the requested reset behavior, then verify that a table can return to its unsorted state without requiring repeated header clicks.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.