Skip to content

fix(material/sort): use initial start direction for unsorted header arrows - #34120

Open
abdul-karim-mia wants to merge 1 commit into
angular:mainfrom
abdul-karim-mia:fix/sort-header-unsorted-hint-direction
Open

abdul-karim-mia wants to merge 1 commit into
angular:mainfrom
abdul-karim-mia:fix/sort-header-unsorted-hint-direction

Conversation

@abdul-karim-mia

Copy link
Copy Markdown

Bind .mat-sort-header-descending and .mat-sort-header-ascending on the sort header container via _getArrowDirection() so that:

  • When a header is actively sorted (_isSorted()), it displays the active _sort.direction.
  • When a header is unsorted (!_isSorted()), its hover/focus hint arrow reflects its own initial sort direction (this.start || this._sort.start) instead of inheriting another sorted column's _sort.direction.

Verification

  • Strict Angular template/TypeScript type-check (ngc) and tslint on src/material/sort
  • Prettier formatting check on modified files
  • Executed all 27 unit specs in src/material/sort/sort.spec.ts (including the new regression test verifying unsorted headers retain their initial start direction while another header is sorted 'desc' and when matSortStart changes) in headless Chrome with TestBed and Jasmine (27 passed, 0 failed)

Fixes #33933

…rrows

Compute the header arrow direction in _getArrowDirection() so unsorted headers use their own start direction instead of inheriting another active header's sort direction.

Fixes angular#33933

Signed-off-by: Abdul karim mia <97598943+abdul-karim-mia@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.

1 participant