Skip to content

Commit d05d40a

Browse files
committed
refactor(offcanvas): use defaultView
1 parent 2c9ae31 commit d05d40a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

projects/coreui-angular/src/lib/offcanvas/offcanvas/offcanvas.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ export class OffcanvasComponent implements OnInit, OnDestroy {
193193
const element: Element = this.document.documentElement;
194194
const responsiveBreakpoint = this.responsive;
195195
const breakpointValue =
196-
getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false;
196+
this.document.defaultView
197+
?.getComputedStyle(element)
198+
?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false;
197199
return breakpointValue ? `${parseFloat(breakpointValue.trim()) - 0.02}px` : false;
198200
}
199201

0 commit comments

Comments
 (0)