Skip to content

fix: Warn correct state usage for modals #8495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Jul 6, 2025

Closes #6547, #6277

✅ 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:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jul 6, 2025

@rspbot
Copy link

rspbot commented Jul 7, 2025

LFDanLu
LFDanLu previously approved these changes Jul 7, 2025
Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

Seems fine to me, wonder if we should additionally add this information in the modal's "isDismissible"/"isOpen"/etc prop descriptions so they are readily available in an IDE's autocomplete so people can catch this even earlier

reidbarber
reidbarber previously approved these changes Jul 7, 2025
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.

We may want to add a process.env.NODE_ENV !== 'production' check here

@snowystinger snowystinger dismissed stale reviews from reidbarber and LFDanLu via 55507b2 July 7, 2025 20:37
@snowystinger snowystinger enabled auto-merge July 7, 2025 20:46
@rspbot
Copy link

rspbot commented Jul 7, 2025

@rspbot
Copy link

rspbot commented Jul 7, 2025

## API Changes

react-aria-components

/react-aria-components:FileTrigger

 FileTrigger {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

/react-aria-components:FileTriggerProps

 FileTriggerProps {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

@react-spectrum/filetrigger

/@react-spectrum/filetrigger:FileTrigger

 FileTrigger {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

/@react-spectrum/filetrigger:FileTriggerProps

 FileTriggerProps {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

@react-spectrum/s2

/@react-spectrum/s2:FileTrigger

 FileTrigger {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

/@react-spectrum/s2:FileTriggerProps

 FileTriggerProps {
   acceptDirectory?: boolean
-  acceptedFileTypes?: ReadonlyArray<string>
+  acceptedFileTypes?: Array<string>
   allowsMultiple?: boolean
   children?: ReactNode
   defaultCamera?: 'user' | 'environment'
   onSelect?: (FileList | null) => void

@snowystinger snowystinger added this pull request to the merge queue Jul 7, 2025
Merged via the queue into main with commit f398fcc Jul 7, 2025
31 checks passed
@snowystinger snowystinger deleted the fix-warn-usage-correct-state-for-dialogs branch July 7, 2025 20:56
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.

Modal & ModalOverlay onOpenChange don't fire
4 participants