Issue #933Opened March 8, 2018by TheMysticMan0 reactions

Setting backgroud image results in duplicate style rules

Question

Hi @artf,

I have one strange little problem. I have a custom trait which has an implementation for setting images and background images. When I set the background image a second time by using the code below I'm getting duplicated styling rules on the element Id.

var style = self.target.getStyle();
// style is empty even though the stylemanager shows the default background image from the class style rule
style['background-image'] ='url("' + newUrl + '")';
self.target.setStyle(style);

I already played around a bit with the forceClass and avoidInlineStyle but it doesn't really help with this problem. Maybe related to this problem: The element also has a class with a default background image. When I open the StyleManager I only see that background image in there. Not the images from the Id style rules. Looks like it doesn't really use them at all?

Thanks in advance!

Answers (2)

artfMarch 8, 20180 reactions

Duplicate of #932

lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.