Skip to content

md-card-media-cover scrim applying [Object object] background #1965

Open
@xxRockOnxx

Description

@xxRockOnxx

Steps to reproduce

  • Just create an <md-card /> component with media-cover that has md-text-scrim.

Which browser?

Chrome

What is expected?

Has scrim background

What is actually happening?

No background because img.onload apparently does not get triggered when vising page directly or refreshing the page. It works if you come from a different page.

Demo

https://codesandbox.io/s/l7vpj917wl

Workaround

  • Add ref to media-cover
  • add mounted hook
  • check if covertStyles.background is type of object
  • manually invoke applyScrimColor(0.6)

Or just use md-solid

Tested on firefox and it worked. Also not a CORS issue because I also tried an image from assets directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions