Skip to content

Commit 2cdd4da

Browse files
committed
fix(document-injection): Update to use injected document
Update several classes in Material and the CDK to reference the injected document instead of accessing the global document and window variables. This fixes use-cases where the document is dynamically provided. This change follows the pattern used in several other places such as the Cdk OverlayContainer.
1 parent 1b3150b commit 2cdd4da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cdk/drag-drop/directives/drag.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,7 @@ describe('CdkDrag', () => {
19481948
// mode in unit tests and there are some issues with doing it in e2e tests.
19491949
const fakeDocument = {
19501950
body: document.body,
1951+
documentElement: document.documentElement,
19511952
fullscreenElement: document.createElement('div'),
19521953
ELEMENT_NODE: Node.ELEMENT_NODE,
19531954
querySelectorAll: function(...args: [string]) {

0 commit comments

Comments
 (0)