Skip to content

Commit

Permalink
refactor: use composed-offset-position instead of custom utils (#6710)
Browse files Browse the repository at this point in the history
**Related Issue:** #6547

## Summary

The composed offset position code is now available as a package we can
use instead. See
floating-ui/floating-ui#2160 (comment)
for more context.
  • Loading branch information
jcfranco authored Apr 8, 2023
1 parent 8327d88 commit 6229ac6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 51 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"cheerio": "1.0.0-rc.10",
"chokidar": "3.5.3",
"chromatic": "6.17.2",
"composed-offset-position": "0.0.4",
"concurrently": "7.6.0",
"conventional-changelog-cli": "2.2.2",
"cpy-cli": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/floating-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function patchFloatingUiForNonChromiumBrowsers(): Promise<void> {
// ⚠️ browser-sniffing is not a best practice and should be avoided ⚠️
(/firefox|safari/i.test(getUAString()) || isChrome109OrAbove())
) {
const { offsetParent } = await import("./floating-ui/utils");
const { offsetParent } = await import("composed-offset-position");

const originalGetOffsetParent = platform.getOffsetParent;
platform.getOffsetParent = (element: Element) => originalGetOffsetParent(element, offsetParent);
Expand Down
50 changes: 0 additions & 50 deletions src/utils/floating-ui/utils.ts

This file was deleted.

0 comments on commit 6229ac6

Please sign in to comment.