Skip to content

Commit 6229ac6

Browse files
authored
refactor: use composed-offset-position instead of custom utils (#6710)
**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.
1 parent 8327d88 commit 6229ac6

File tree

4 files changed

+15
-51
lines changed

4 files changed

+15
-51
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"cheerio": "1.0.0-rc.10",
117117
"chokidar": "3.5.3",
118118
"chromatic": "6.17.2",
119+
"composed-offset-position": "0.0.4",
119120
"concurrently": "7.6.0",
120121
"conventional-changelog-cli": "2.2.2",
121122
"cpy-cli": "^4.0.0",

src/utils/floating-ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function patchFloatingUiForNonChromiumBrowsers(): Promise<void> {
6161
// ⚠️ browser-sniffing is not a best practice and should be avoided ⚠️
6262
(/firefox|safari/i.test(getUAString()) || isChrome109OrAbove())
6363
) {
64-
const { offsetParent } = await import("./floating-ui/utils");
64+
const { offsetParent } = await import("composed-offset-position");
6565

6666
const originalGetOffsetParent = platform.getOffsetParent;
6767
platform.getOffsetParent = (element: Element) => originalGetOffsetParent(element, offsetParent);

src/utils/floating-ui/utils.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)