Skip to content

Commit

Permalink
fix: fix shadowdom/frame support for file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Jan 17, 2024
1 parent a22cde3 commit 0ee3634
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-avocados-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@saas-ui/file-upload': patch
---

Retrieve environment from Chakra UI context to support shadowdom/frame for file uploads
2 changes: 1 addition & 1 deletion packages/pro
Submodule pro updated from 33568c to 34a337
8 changes: 7 additions & 1 deletion packages/saas-ui-file-upload/src/file-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ButtonProps,
Image,
ImageProps,
useEnvironment,
} from '@chakra-ui/react'

import { pick, runIfFn, split } from '@chakra-ui/utils'
Expand Down Expand Up @@ -50,7 +51,12 @@ export const FileUpload = forwardRef<FileUploadProps, 'div'>((props, ref) => {
'getRootNode',
])

const context = useFileUpload(options)
const env = useEnvironment()

const context = useFileUpload({
getRootNode: env.getDocument,
...options,
})

const styles = useMultiStyleConfig('SuiFileUpload', {
styleConfig: fileUploadTheme,
Expand Down

0 comments on commit 0ee3634

Please sign in to comment.