bug(COMPONENT): Table is sorted on press SPACE or ENTER
Is this a regression?
- [X] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
17.1.2
Description
Since MatSortHeader listens keydowm event and _handleKeydown($event) method toggle sort on focused column it makes both confusing users and side effect on rest Angular application. Prease, either provide Input for disabling toggle sorting on defined column or remove this listening event at all
@Component({ selector: '[mat-sort-header]', exportAs: 'matSortHeader', templateUrl: 'sort-header.html', styleUrl: 'sort-header.css', host: { 'class': 'mat-sort-header', '(click)': '_handleClick()', '(keydown)': '_handleKeydown($event)', '(mouseenter)': '_setIndicatorHintVisible(true)', '(mouseleave)': '_setIndicatorHintVisible(false)', '[attr.aria-sort]': '_getAriaSortAttribute()', '[class.mat-sort-header-disabled]': '_isDisabled()', }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [ matSortAnimations.indicator, matSortAnimations.leftPointer, matSortAnimations.rightPointer, matSortAnimations.arrowOpacity, matSortAnimations.arrowPosition, matSortAnimations.allowChildren, ], standalone: true, }) export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit {
Reproduction
StackBlitz link: Steps to reproduce: 1. 2.
Expected Behavior
Table won't be sorted on press SPACE or ENTER
Actual Behavior
Table is sorted on press SPACE or ENTER
Environment
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Can you paste your code example into a Stackblitz: Components StackBlitz starter
Closing since there hasn't been any response.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.