Skip to content

bug (cdk/drag-drop): Can't add Theme style '.cdk-drag-preview' #19494

@Gil-Epshtain

Description

@Gil-Epshtain
  • The theme class is set on the app-component which is the first (and only) element of the body.
  • When executing drag-and-drop the dragged element (with the class .cdk-drag-preview) is attached to the body.

Due to this the .cdk-drag-preview isn't controlled by themes system.

This bug was already reported twice see:

  1. Drag and drop - missing styles after theme changing #17089
  2. feat(drag-drop): allow for custom class to be set on preview #17304

The first bug was resolved with a workaround - Set the theme class directly on the body, not on the app-component.
The 2nd bug was resolved with some code change by the material team.

However I'm still getting this problem. Can someone tell me how to fix this?? (putting the theme selector on the body will not work for me)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions