Skip to content

Commit

Permalink
Fix update preview leads to page freshes when set background image
Browse files Browse the repository at this point in the history
  • Loading branch information
cychiuae committed Jul 2, 2024
1 parent 28c0539 commit 7f97255
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion authui/src/inline-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export class InlinePreviewController extends Controller {
}
const el = this.element as HTMLElement;
for (const [name, value] of Object.entries(customisationMessage.cssVars)) {
el.style.setProperty(name, value);
const currentStyle = el.style.getPropertyValue(name);
if (currentStyle !== value) {
el.style.setProperty(name, value);
}
}

const keyToPreviewableResourceController: Partial<
Expand Down

0 comments on commit 7f97255

Please sign in to comment.