NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.92k forks source link

Table hides the sorting icons when using `nzSortDirections` #6975

Closed IonelLupu closed 3 years ago

IonelLupu commented 3 years ago

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-kgyh4r?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

Create a table with sortable columns and set the sort direction to something else using the [nzSortDirections] attribute

What is expected?

It is excepted the sort icons to stay visible

What is actually happening?

The sort icons disappear

image

Environment Info
ng-zorro-antd 12.0.1
Browser *
simplejason commented 3 years ago

nzSortDirections should be Array<'ascend' | 'descend' | null>, not asc or desc

IonelLupu commented 3 years ago

@simplejason The default value is already Array<'ascend' | 'descend' | null>. I thought nzSortDirections is used for changing the names of the sort directions from the default value to something else. For example, our backend is using asc and desc instead of ascend and descend.

I see nzSortDirections is used to remove some sort directions but is there any use case with this behavior? Why would a table want to be sorted in one direction and not the other one?