Skip to content

Conversation

@au5ton
Copy link
Contributor

@au5ton au5ton commented Oct 23, 2025

Fixes #6028

I've also added private/dev/dashboard_shadow.html to more easily test ShadowDOM-specific bugs.

I looked into writing a test case under packages/@uppy/dashboard/src/index.browser.test.ts but couldn't get it to work locally on Windows.


Note

Ensure FileCard’s hidden form is appended/cleaned up in the correct root (Document body or ShadowRoot) using a ref-derived root node, and add a patch changeset.

  • @uppy/dashboard – FileCard:
    • Append hidden form to the correct root using getRootNode() (handles Light DOM/iframes via Document.body, and Shadow DOM via ShadowRoot).
    • Add domRef to root element to detect rendering context; attach ref and update effect accordingly.
    • Clean up by removing the form from its actual parentNode.
  • Release:
    • Add changeset for patch: Fix form appending for shadow dom.

Written by Cursor Bugbot for commit edf81e8. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2025

🦋 Changeset detected

Latest commit: edf81e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@uppy/dashboard Patch
@uppy/react Patch
@uppy/remote-sources Patch
@uppy/svelte Patch
@uppy/vue Patch
@uppy/angular Patch
uppy Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. But we probably don't need the new dev environment, I don't think we'll use it. A test would be great but you mentioned that's difficult. It also doesn't work in WSL? If not, then we can leave it for now

@Murderlon Murderlon changed the title Fix #6028 @uppy/dashboard: fix form appending for shadow dom Oct 24, 2025
@au5ton
Copy link
Contributor Author

au5ton commented Oct 28, 2025

@Murderlon I couldn't get it to work under WSL either, sorry :(

@Murderlon
Copy link
Member

Can you remove the dev setup and resolve the CI errors?

@au5ton
Copy link
Contributor Author

au5ton commented Oct 30, 2025

@Murderlon As requested, I removed the "dashboard_shadow.html" file and addressed the lint issues. Thank you for your consideration.

@Murderlon Murderlon merged commit 5e166a1 into transloadit:main Nov 3, 2025
7 of 8 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

* Use the "rootNode" of whereever Uppy is rendered, falling back
* to `window.document` if domRef isn't initialized for some reason
*/
const rootNode = domRef.current?.getRootNode() ?? (document as Node)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Guarding getRootNode: handle absent method gracefully

domRef.current?.getRootNode() only guards domRef.current being nullish, not the presence of getRootNode. In environments where Node.getRootNode is undefined (older/legacy browsers or certain polyfilled contexts), this will throw TypeError: getRootNode is not a function. Use domRef.current?.getRootNode?.() (or a safe fallback like ownerDocument) to avoid a runtime crash.

Fix in Cursor Fix in Web

@au5ton au5ton deleted the feature/fix-6028 branch November 4, 2025 15:13
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.

Uppy Dashboard 4.X meta fields don't work inside Shadow DOMs

2 participants