Skip to content

Commit

Permalink
fix(js): remove window references (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour authored Mar 25, 2021
1 parent 77a092d commit 7628d09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/autocomplete-js/src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function autocomplete<TItem extends BaseItem>(
toggleModalClassname(event.matches);
}

const isModalDetachedMql = window.matchMedia(
const isModalDetachedMql = props.value.core.environment.matchMedia(
getComputedStyle(
props.value.core.environment.document.documentElement
).getPropertyValue('--aa-detached-modal-media-query')
Expand Down
4 changes: 2 additions & 2 deletions packages/autocomplete-js/src/getPanelPlacementStyle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AutocompleteOptions } from './types';

type GetPanelPlacementStyleParams = Pick<
AutocompleteOptions<any>,
Required<AutocompleteOptions<any>>,
'panelPlacement' | 'environment'
> & {
container: HTMLElement;
Expand All @@ -12,7 +12,7 @@ export function getPanelPlacementStyle({
panelPlacement,
container,
form,
environment = window,
environment,
}: GetPanelPlacementStyleParams) {
const containerRect = container.getBoundingClientRect();
const top = container.offsetTop + containerRect.height;
Expand Down

0 comments on commit 7628d09

Please sign in to comment.