🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@maesse
Copy link

@maesse maesse commented Sep 21, 2025

This PR updates autoUpdate to allow for floating to be null

dom/src/autoUpdate.ts:

function autoUpdate(
  reference: ReferenceElement,
- floating: FloatingElement,
+ floating: FloatingElement | null,
  update: () => void,
  options: AutoUpdateOptions = {},
)

Motivation:
This enables use cases where you only want to track changes to the reference element without necessarily having a floating element.

Impact:
No breaking changes.
Expands the function’s flexibility for broader scenarios.

@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2025

⚠️ No Changeset found

Latest commit: ee91802

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Sep 21, 2025

Deploy Preview for vibrant-gates-22c214 ready!

Name Link
🔨 Latest commit ee91802
🔍 Latest deploy log https://app.netlify.com/projects/vibrant-gates-22c214/deploys/68d025f1d443900008e3cb04
😎 Deploy Preview https://deploy-preview-3399--vibrant-gates-22c214.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 21, 2025

Open in StackBlitz

@floating-ui/core

npm i https://pkg.pr.new/@floating-ui/core@3399

@floating-ui/dom

npm i https://pkg.pr.new/@floating-ui/dom@3399

@floating-ui/react

npm i https://pkg.pr.new/@floating-ui/react@3399

@floating-ui/react-dom

npm i https://pkg.pr.new/@floating-ui/react-dom@3399

@floating-ui/react-native

npm i https://pkg.pr.new/@floating-ui/react-native@3399

@floating-ui/utils

npm i https://pkg.pr.new/@floating-ui/utils@3399

@floating-ui/vue

npm i https://pkg.pr.new/@floating-ui/vue@3399

commit: ee91802

@atomiks
Copy link
Collaborator

atomiks commented Nov 29, 2025

Are you using this outside a Floating UI/anchoring kind of context?

@maesse
Copy link
Author

maesse commented Nov 29, 2025

Hi atomiks,

I'm basically using only the positional tracking, because my use case is rendering a bunch of lines in an SVG overlay that connects DOM elements.

Do you think it could be useful to expose that functionality? My thinking was, it's already there, the tracking works great, with a few tweaks to the interface it would allow for cases where it's necessary to do custom rendering (or maybe just tracking positions alone for whatever reason). I was looking for libraries to solve this issue and this was the closest/best I found.

I do realize though that it might be a bit outside the core purpose of the library, and my PR might not be the cleanest solution. I'll admit that it's mostly for my own convenience that I submitted this PR, since it would save me the hassle of having a fork :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants