-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(popover): added control for closing popover on scroll #3595
feat(popover): added control for closing popover on scroll #3595
Conversation
🦋 Changeset detectedLatest commit: 04fb659 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
@awesome-pro is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis update enhances the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- .changeset/slow-paws-punch.md (1 hunks)
- packages/components/popover/tests/popover.test.tsx (1 hunks)
- packages/components/popover/src/use-aria-popover.ts (3 hunks)
- packages/components/popover/src/use-popover.ts (2 hunks)
- packages/components/popover/stories/popover.stories.tsx (2 hunks)
Additional comments not posted (10)
.changeset/slow-paws-punch.md (1)
1-5
: LGTM!The changeset description is clear and concise, summarizing the feature added.
packages/components/popover/src/use-aria-popover.ts (3)
40-44
: LGTM!The addition of the
shouldCloseOnScroll
property is well-documented and aligns with the feature described in the PR summary.
68-68
: LGTM!The updated function signature of
useReactAriaPopover
includes theshouldCloseOnScroll
property, ensuring the feature is configurable.
111-111
: LGTM!The internal logic modification ensures that the popover only closes on scroll if both
isNonModal
andshouldCloseOnScroll
are true, aligning with the intended behavior.packages/components/popover/src/use-popover.ts (2)
121-121
: LGTM!The addition of the
shouldCloseOnScroll
parameter in the destructuring oforiginalProps
ensures that the feature is configurable through theusePopover
function.
173-173
: LGTM!The updated function call to
useReactAriaPopover
includes theshouldCloseOnScroll
parameter, ensuring the feature is utilized within theusePopover
function.packages/components/popover/__tests__/popover.test.tsx (2)
318-318
: Updated test description is accurate.The updated test description correctly specifies the condition being tested.
320-320
: PropshouldCloseOnScroll
correctly added toPopover
component.The
shouldCloseOnScroll
prop is correctly added to thePopover
component, ensuring the test reflects the intended functionality.packages/components/popover/stories/popover.stories.tsx (2)
84-88
: PropertyshouldCloseOnScroll
correctly added with control type "boolean".The
shouldCloseOnScroll
property is correctly added with a control type of "boolean", allowing it to be toggled in the storybook interface.
461-468
: New exportShouldNotCloseOnScroll
correctly added.The new export
ShouldNotCloseOnScroll
accurately demonstrates the behavior whenshouldCloseOnScroll
is set tofalse
.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
since you've introduced a new prop, please update the documentation as well.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .changeset/slow-paws-punch.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .changeset/slow-paws-punch.md
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/components/popover/stories/popover.stories.tsx (1 hunks)
Additional comments not posted (1)
packages/components/popover/stories/popover.stories.tsx (1)
84-88
: LGTM! The new propertyshouldCloseOnScroll
is correctly integrated.The addition of the
shouldCloseOnScroll
property with a control type "boolean" is correct and aligns with the PR objectives.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/components/popover/tests/popover.test.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/components/popover/tests/popover.test.tsx
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/docs/content/docs/components/popover.mdx (1 hunks)
Additional comments not posted (2)
apps/docs/content/docs/components/popover.mdx (2)
170-170
: Change approved:shouldBlockScroll
default value updated totrue
.This change enhances user experience by preventing background content from being scrolled while the popover is active.
171-171
: Change approved: AddedshouldCloseOnScroll
property with default valuefalse
.This addition allows for more flexible control over the popover's behavior in response to user interactions.
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
🧹 Outside diff range and nitpick comments (1)
.changeset/slow-paws-punch.md (1)
1-5
: LGTM! Consider a minor enhancement to the description.The changeset correctly identifies this as a minor version update and provides a clear, concise description of the new feature. Good job referencing the associated issue number for traceability.
To further improve clarity, consider slightly expanding the description to highlight the default behavior:
- added `shouldCloseOnScroll` to control the popover closing on scroll (#3594) + added `shouldCloseOnScroll` to control the popover closing on scroll (default: true) (#3594)This minor addition explicitly states the default behavior, which could be helpful for users quickly scanning the changelog.
Thank you! @awesome-pro |
* fix(navbar): fixed the height when style h-full * fix(navbar): fixed the height when style h-full * docs(changeset): resolved extra file * feat(popover): added control for closing popover on scroll * update(changeset): correction * feat(popover): removed extra story * refactor(test): corrected test for both true and false values of shouldCloseOnScroll * refactor(docs): added shouldCloseOnScroll prop * chore(changeset): change to minor --------- Co-authored-by: աӄա <[email protected]>
Closes #3594
📝 Description
Added a new control
shouldCloseOnScroll
(default true) to control the closing of popover on scroll.⛳️ Current behavior (updates)
prev-popover.mov
🚀 New behavior
new-popover.mov
💣 Is this a breaking change (Yes/No): NO
📝 Additional Information
Summary by CodeRabbit
New Features
Bug Fixes
shouldCloseOnScroll
property.