stylesheet update condition
# Conflicts: # src/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.ts # Conflicts: # src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts # src/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.ts
This commit is contained in:
@@ -46,10 +46,10 @@ export class UmbBlockGridAreasContainerElement extends UmbLitElement {
|
||||
manager.layoutStylesheet,
|
||||
(stylesheet) => {
|
||||
// Do not re-render stylesheet if its the same href.
|
||||
if (!stylesheet || this._styleElement?.getAttribute('href') === stylesheet) return;
|
||||
if (!stylesheet || this._styleElement?.href === stylesheet) return;
|
||||
this._styleElement = document.createElement('link');
|
||||
this._styleElement.setAttribute('rel', 'stylesheet');
|
||||
this._styleElement.setAttribute('href', stylesheet);
|
||||
this._styleElement.rel = 'stylesheet';
|
||||
this._styleElement.href = stylesheet;
|
||||
},
|
||||
'observeStylesheet',
|
||||
);
|
||||
|
||||
@@ -209,11 +209,10 @@ export class UmbBlockGridEntriesElement extends UmbFormControlMixin(UmbLitElemen
|
||||
this.observe(
|
||||
manager.layoutStylesheet,
|
||||
(stylesheet) => {
|
||||
if (!stylesheet) return;
|
||||
if (this._styleElement?.href === stylesheet) return;
|
||||
if (!stylesheet || this._styleElement?.href === stylesheet) return;
|
||||
this._styleElement = document.createElement('link');
|
||||
this._styleElement.setAttribute('rel', 'stylesheet');
|
||||
this._styleElement.setAttribute('href', stylesheet);
|
||||
this._styleElement.rel = 'stylesheet';
|
||||
this._styleElement.href = stylesheet;
|
||||
},
|
||||
'observeStylesheet',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user