-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: correctly dismissable default value #4524
base: canary
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: eea1e03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
WalkthroughThe pull request introduces a new optional Changes
Possibly related PRs
Suggested reviewers
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/components/modal/src/use-modal.ts (2)
84-87
: Consider extracting shared typesSince both modal and popover components now share the
isDismissable
property with identical behavior, consider extracting it to a shared interface.Example implementation:
// @nextui-org/shared-utils interface DismissableProps { /** * Whether to close the overlay when the user interacts outside it. * @default true */ isDismissable?: boolean; } // In modal and popover interface Props extends DismissableProps { // ... other props }
Line range hint
45-49
: Architectural consistency achievedThe implementation of
isDismissable
across both modal and popover components demonstrates good architectural decisions:
- Consistent behavior for overlay dismissal
- Proper type safety with React Aria integration
- Backward compatibility maintained with default value
- Uniform documentation across components
This change improves the component library's API consistency.
Also applies to: 77-81
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.changeset/lucky-parrots-compete.md
(1 hunks)packages/components/modal/src/use-modal.ts
(1 hunks)packages/components/popover/src/use-aria-popover.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/lucky-parrots-compete.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: TypeScript
- GitHub Check: Build
🔇 Additional comments (3)
packages/components/popover/src/use-aria-popover.ts (2)
45-49
: Well-documented property additionThe JSDoc for the new
isDismissable
property is clear and includes the default value.
52-54
: Verify type compatibility with React AriaThe type modification correctly prevents property collision by omitting
isDismissable
fromAriaOverlayProps
. However, we should ensure this aligns with the latest React Aria types.✅ Verification successful
Type compatibility with React Aria is correct
The omission of
isDismissable
fromAriaOverlayProps
is intentional and properly implemented. The type modification follows React Aria's patterns for overlay components customization.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check React Aria version and type definitions grep "@react-aria/overlays" package.json cat node_modules/@react-aria/overlays/dist/types.d.ts | grep -A 5 "interface AriaOverlayProps"Length of output: 219
Script:
#!/bin/bash # Find all package.json files and search for react-aria dependencies fd package.json --exec grep -l "@react-aria" # Search for imports from @react-aria/overlays rg "from ['\"]\@react-aria\/overlays['\"]" -A 2 # Search for AriaOverlayProps usage rg "AriaOverlayProps"Length of output: 2720
Script:
#!/bin/bash # Check tooltip implementation ast-grep --pattern 'import { $$ } from "@react-aria/overlays"' packages/components/tooltip/src/use-tooltip.ts rg -A 10 "AriaOverlayProps" packages/components/tooltip/src/use-tooltip.ts # Check popover implementation ast-grep --pattern 'import { $$ } from "@react-aria/overlays"' packages/components/popover/src/use-aria-popover.ts rg -A 10 "AriaOverlayProps" packages/components/popover/src/use-aria-popover.tsLength of output: 1820
packages/components/modal/src/use-modal.ts (1)
77-81
: Consistent property documentationThe JSDoc for
isDismissable
matches the popover implementation, maintaining consistency across components.
Closes #
📝 Description
⛳️ Current behavior (updates)
Comment default value is false
🚀 New behavior
Change to true same with the docs
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
Release Notes
New Features
isDismissable
option for modal and popover componentstrue
for both componentsBug Fixes
Improvements