components icon indicating copy to clipboard operation
components copied to clipboard

bug(COMPONENT): Table is sorted on press SPACE or ENTER

Open sashko687 opened this issue 1 year ago • 1 comments

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):

sashko687 avatar Sep 17 '24 12:09 sashko687

Can you paste your code example into a Stackblitz: Components StackBlitz starter

amysorto avatar Sep 23 '24 17:09 amysorto

Closing since there hasn't been any response.

crisbeto avatar Dec 03 '24 07:12 crisbeto

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.