Skip to content

When adding and removing style rules like background, sub rules (background-color) are not re applied #7756

@posva

Description

@posva

Version

2.5.13

Reproduction link

https://codesandbox.io/s/40opo3n4lw

Steps to reproduce

  • Add background, set value to red, click ADD
  • see the box in red
  • Click on REMOVE
  • Check the box

What is expected?

The box should be gray again

What is actually happening?

the box has no background-color


This bug was found by @MatWaligora in discord

The problem is that when we update styles, we do not reapply background-color and other properties because they were already applied but, in the browser, if you apply background, it will modify the other style.backgroundColor, style.backgroundPosition, etc, . So we think styles do not need to be reapplied but because setting background have some side effects we need to reapply all other background- properties. It's probably the same with other rules like border

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions