Skip to content

bug(MatSort): MatSort prevents animation callbacks inside MatTable #28158

Open
@cusher

Description

@cusher

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When a MatSort is applied to a MatTable, the animation start/done callbacks do not (sometimes) work. Even though the animation appears to happen, the callbacks do not get called. When the sort is not applied, this does not ever seem to be the case.

This seems to be related to changes to/from void, but as best I can tell from the docs, these should still trigger the callbacks.

I believe this is related to this issue #13431 in that both are related to the sort causing animation to default to void (instead of whatever the default state is when rows are not sorted).

Reproduction

StackBlitz link: https://stackblitz.com/edit/sreaf6
Steps to reproduce:

  1. Click the "symbol" header once to sort by symbol.
  2. Click the Fluorine row to expand the row details.
  3. Repeatedly collapse and expand this row.

Expected Behavior

The "Last animation" section on the row should change between:

  • Last animation: Fluorine - expanded started
  • Last animation: Fluorine - expanded done
  • Last animation: Fluorine - collapsed started
  • Last animation: Fluorine - collapsed done

(depending on the last user action and whether the animation is still in progress)

Additionally, the console should have logged each of these animation state changes occurring for the row.

Actual Behavior

The "Last animation" section on the row just says "Last animation: Neon - void done".

The console never logs either collapse or expand animations starting or finishing, even though the animation event is clearly occurring.

Environment

  • Angular: 16.2.8, 17.0.0
  • CDK/Material: 16.2.10, 17.0.1
  • Browser(s): Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

Activity

added
P4A relatively minor issue that is not relevant to core functions
and removed
needs triageThis issue needs to be triaged by the team
on Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/table

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @amysorto@cusher

        Issue actions

          bug(MatSort): MatSort prevents animation callbacks inside MatTable · Issue #28158 · angular/components