fix(overlay): avoid calling push in iterable object to avoid error loading overlays (#2088)

This commit is contained in:
alejandrofernandezcanton 2023-10-17 14:44:51 +02:00 committed by GitHub
parent dcf3a4b0bd
commit b1320a9a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/ui': patch
---
avoid calling push in iterable object to avoid error loading overlays in old chromium versions

4
package-lock.json generated
View file

@ -22698,7 +22698,7 @@
},
"packages/ajax": {
"name": "@lion/ajax",
"version": "1.2.1",
"version": "1.2.3",
"license": "MIT"
},
"packages/singleton-manager": {
@ -22707,7 +22707,7 @@
},
"packages/ui": {
"name": "@lion/ui",
"version": "0.4.0-prerelease-bypass-export-map.0",
"version": "0.4.1",
"license": "MIT",
"dependencies": {
"@bundled-es-modules/message-format": "^6.0.4",

View file

@ -119,7 +119,7 @@ export function adoptStyle(renderRoot, style, { teardown = false } = {}) {
if (!teardown) {
// @ts-ignore
// eslint-disable-next-line no-param-reassign
renderRoot.adoptedStyleSheets.push(sheet);
renderRoot.adoptedStyleSheets = [...renderRoot.adoptedStyleSheets, sheet];
} else if (renderRoot.adoptedStyleSheets.includes(sheet)) {
renderRoot.adoptedStyleSheets.splice(renderRoot.adoptedStyleSheets.indexOf(sheet), 1);
}