Skip to content

Conversation

@ryo-manba
Copy link
Contributor

@ryo-manba ryo-manba commented Nov 20, 2023

Closes #4963

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Verified that only directories are selected when the UNSAFE_directory property is applied.
Added test to verify that the webkitdirectory property is applied.

🧢 Your Project:

multiple={allowsMultiple} />
multiple={allowsMultiple}
// @ts-expect-error
webkitdirectory={UNSAFE_directory ? '' : undefined} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this implementation uses an empty string for the webkitdirectory attribute instead of a boolean value because it does not function correctly with boolean.

ref: facebook/react#3468 (comment)

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!


## Directory Selection

To enable selecting directories instead of files, use the `UNSAFE_directory` property.
Copy link
Member

Choose a reason for hiding this comment

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

Since it looks like this is well-supported with browsers we support, I think we can just use directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by the following commit.

refac: Remove unsafe prefix


To enable selecting directories instead of files, use the `UNSAFE_directory` property.

This reflects the webkitdirectory HTML attribute and allows users to select directories and their contents.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment. Link added.
refac: Remove unsafe prefix

@ryo-manba ryo-manba requested a review from reidbarber November 20, 2023 23:56
yihuiliao
yihuiliao previously approved these changes Nov 21, 2023
Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

GET_BUILD

@reidbarber
Copy link
Member

GET_BUILD

@rspbot
Copy link

rspbot commented Nov 21, 2023

@rspbot
Copy link

rspbot commented Nov 21, 2023

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

Updated section title to match formatting of others
Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@yihuiliao yihuiliao merged commit a3d77ab into adobe:main Nov 21, 2023
@ryo-manba ryo-manba deleted the feat/directory-support-file-trigger branch January 5, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add directory support for FileTrigger

5 participants