Skip to content

Commit 03e15cb

Browse files
Fix freezing tabs on Safari (#1770)
Co-authored-by: Sébastien Levert <[email protected]>
1 parent 47eebe2 commit 03e15cb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.storybook/addons/codeEditorAddon/codeAddon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const withCodeEditor = makeDecorator({
198198
doc.open();
199199
doc.write(docContent);
200200
doc.close();
201-
});
201+
}, {once:true});
202202

203203
storyElement.className = 'story-mgt-preview';
204204
storyElement.setAttribute('title', 'preview');

.storybook/addons/codeEditorAddon/editor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export class EditorElement extends LitElement {
177177
}
178178

179179
disconnectedCallback() {
180+
this.editor.removeEventListener('fileUpdated');
180181
window.removeEventListener('resize', this.handleResize);
181182
}
182183

@@ -193,7 +194,7 @@ export class EditorElement extends LitElement {
193194
this.editor.restoreViewState(this.currentEditorState.state);
194195
}
195196

196-
if(this.autoFormat) {
197+
if (this.autoFormat) {
197198
this.editor.getAction('editor.action.formatDocument').run();
198199
}
199200
}

0 commit comments

Comments
 (0)