mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
fix: Allow for unattached elements during inject call (#7149)
Change-Id: I616cb30b8a3292b3be9f58536d7bfb9444e529d4
This commit is contained in:
@@ -46,7 +46,10 @@ export function inject(
|
||||
containerElement = container;
|
||||
}
|
||||
// Verify that the container is in document.
|
||||
if (!document.contains(containerElement)) {
|
||||
if (
|
||||
!document.contains(containerElement) &&
|
||||
document !== containerElement?.ownerDocument
|
||||
) {
|
||||
throw Error('Error: container is not in current document');
|
||||
}
|
||||
const options = new Options(opt_options || ({} as BlocklyOptions));
|
||||
|
||||
Reference in New Issue
Block a user