Skip to content

Cannot use multiple classes separated by space in animate.leave #62964

@imaksp

Description

@imaksp

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

No

Description

Add div like this in any component and remove it from DOM to trigger leave animation :

<div
  class="border-ring/10 animate-fade animate-duration-500 tracking-wide backdrop-blur-sm"
  cdkMenu
  animate.leave="animate-jump-out animate-duration-300"
>
  menu items
</div>

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

root_effect_scheduler.mjs:3597 ERROR InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('animate-jump-out animate-duration-300') contains HTML space characters, which are not valid in tokens.
    at NoneEncapsulationDomRenderer.addClass (dom_renderer.mjs:658:18)

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 20.2.0-next.2
Node: 22.14.0
Package Manager: yarn 4.9.2
OS: darwin arm64

Angular: 20.2.0-next.3
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2002.0-next.2
@angular-devkit/core         20.2.0-next.2
@angular-devkit/schematics   20.2.0-next.2
@angular/build               20.2.0-next.2
@angular/cdk                 20.1.4
@angular/cli                 20.2.0-next.2
@angular/ssr                 20.2.0-next.2
@schematics/angular          20.2.0-next.2
rxjs                         7.8.2
typescript                   5.9.2

Anything else?

it should work correctly with multiple classes in animate.out. (Currently it works only if we provide single class name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecore: animationsIssues related to `animate.enter` and `animate.leave`

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions