Skip to content

Commit 46d77f9

Browse files
authored
fix: Use push/splice to avoid Safari 16.4 issue (#16915)
Workaround for https://bugs.webkit.org/show_bug.cgi?id=254844 Fixes #16909
1 parent a9d5f16 commit 46d77f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

flow-server/src/main/resources/META-INF/frontend/theme-util.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ const addAdoptedStyle = (cssText, target, first) => {
4646
const sheet = new CSSStyleSheet();
4747
sheet.replaceSync(cssText);
4848
if (first) {
49-
target.adoptedStyleSheets = [sheet, ...target.adoptedStyleSheets];
49+
target.adoptedStyleSheets.splice(0, 0, sheet);
5050
} else {
51-
target.adoptedStyleSheets = [...target.adoptedStyleSheets, sheet];
51+
target.adoptedStyleSheets.push(sheet);
5252
}
5353
return () => {
54-
target.adoptedStyleSheets = target.adoptedStyleSheets.filter(ss => ss !== sheet);
55-
}
54+
target.adoptedStyleSheets.splice(target.adoptedStyleSheets.indexOf(sheet), 1);
55+
};
5656
};
5757

5858
const addStyleTag = (cssText, referenceComment) => {

0 commit comments

Comments
 (0)