Skip to content

Commit 0de2a84

Browse files
authored
Make elementToAppend take priority over domID for sandbox configs (#2886)
1 parent 3253346 commit 0de2a84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/sandbox/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const createTypeScriptSandbox = (
144144

145145
const language = languageType(config)
146146
const filePath = createFileUri(config, compilerOptions, monaco)
147-
const element = "domID" in config ? document.getElementById(config.domID) : (config as any).elementToAppend
147+
const element = (config as any).elementToAppend ? (config as any).elementToAppend : document.getElementById(config.domID)
148148

149149
const model = monaco.editor.createModel(defaultText, language, filePath)
150150
monaco.editor.defineTheme("sandbox", sandboxTheme)

0 commit comments

Comments
 (0)