fix: Allow for unattached elements during inject call (#7149)

Change-Id: I616cb30b8a3292b3be9f58536d7bfb9444e529d4
This commit is contained in:
Evan W. Patton
2023-06-13 12:30:45 -04:00
committed by GitHub
parent 06b4aa71d7
commit f37380969a

View File

@@ -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));