Skip to content

Bug: ViewTransition name prop does not support numerical prefixes #33015

Open
@roarosa

Description

@roarosa

ViewTransition does not animate if a name prop starting with a number is provided. Presumably this is because the name is being used as a CSS class, but that is not obvious from the documentation.

React version: experimental

Steps To Reproduce

  1. Create a ViewTransition with the name "1name" that wraps an element
  2. Insert or remove the ViewTransition

Link to code example: https://codesandbox.io/p/sandbox/hopeful-dawn-cfgv64

The current behavior

Animation does not fire and no errors or warnings present

The expected behavior

One of the following:

  1. The ViewTransition applies (e.g. by escaping the name)
  2. An warning is logged for invalid ViewTransition name
  3. The React docs are updated to call out that name must be a valid CSS name

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions