-
-
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(tooltip): Tooltip shouldBlockScroll doesn't work #3475
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Someone is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 7da6c28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 updates implement a new Changes
Assessment against linked issues
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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 ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (6)
- .changeset/modern-pianos-destroy.md (1 hunks)
- packages/components/popover/src/popover-content.tsx (1 hunks)
- packages/components/tooltip/package.json (1 hunks)
- packages/components/tooltip/src/tooltip.tsx (4 hunks)
- packages/components/tooltip/src/use-tooltip.ts (6 hunks)
- packages/components/tooltip/stories/tooltip.stories.tsx (3 hunks)
Files skipped from review due to trivial changes (1)
- packages/components/popover/src/popover-content.tsx
Additional comments not posted (7)
.changeset/modern-pianos-destroy.md (1)
1-5
: Changeset file is accurate and complete.The changeset correctly reflects the major version update and the bug fix for issue #3474.
packages/components/tooltip/package.json (1)
37-41
: Dependency addition is correct.The
react-remove-scroll
dependency is correctly added, and other configurations remain intact.Also applies to: 46-47, 55-56
packages/components/tooltip/src/tooltip.tsx (1)
9-9
: Integration ofRemoveScroll
and handling ofshouldBlockScroll
are correct.The
RemoveScroll
component is correctly integrated, and theshouldBlockScroll
property is properly handled to manage scrolling behavior.Also applies to: 57-57, 79-94
packages/components/tooltip/src/use-tooltip.ts (1)
7-7
: Handling ofshouldBlockScroll
inuseTooltip
is correct.The
shouldBlockScroll
property is correctly integrated and handled within theuseTooltip
hook to manage scrolling behavior.Also applies to: 20-20, 83-86, 128-128, 253-253, 268-268
packages/components/tooltip/stories/tooltip.stories.tsx (3)
41-45
: LGTM! AddingshouldBlockScroll
to argTypes is appropriate.This change allows users to control the
shouldBlockScroll
property through the Storybook UI.
291-296
: LGTM! TheDisbaleScrollbar
export is well-defined.This export demonstrates the usage of the
shouldBlockScroll
property by disabling scroll blocking.
395-395
: LGTM! TheAlwaysOpen
export is well-defined.This export demonstrates the usage of the
shouldBlockScroll
property by enabling scroll blocking.
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/modern-pianos-destroy.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .changeset/modern-pianos-destroy.md
@@ -380,6 +392,7 @@ export const AlwaysOpen = { | |||
...defaultProps, | |||
isOpen: true, | |||
showArrow: true, | |||
shouldBlockScroll: true, |
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.
default is true
already
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.
Changes Done
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.
remove this line
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.
line removed
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 (3)
- .changeset/modern-pianos-destroy.md (1 hunks)
- packages/components/tooltip/src/use-tooltip.ts (6 hunks)
- packages/components/tooltip/stories/tooltip.stories.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (3)
- .changeset/modern-pianos-destroy.md
- packages/components/tooltip/src/use-tooltip.ts
- packages/components/tooltip/stories/tooltip.stories.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.
i think there is no need to add DisableScrollbar and update AlwaysOpen in tooltip.stories.tsx. Just adding L41 - L45 is fine.
@@ -380,6 +392,7 @@ export const AlwaysOpen = { | |||
...defaultProps, | |||
isOpen: true, | |||
showArrow: true, | |||
shouldBlockScroll: true, |
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.
remove this line
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/tooltip/stories/tooltip.stories.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/components/tooltip/stories/tooltip.stories.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)
- packages/components/tooltip/src/use-tooltip.ts (6 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/components/tooltip/src/use-tooltip.ts
<RemoveScroll enabled={shouldBlockScroll && isOpen} removeScrollBar={false}> | ||
{trigger} |
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.
This causes the trigger to be wrapped in a div
. RemoveScroll should be wrapped in content!?
Why not use the usePreventScroll
Hook?
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.
@chirokas That's a good point. I forgot you've made that PR already. Can you also apply the changes in your PR so that I could close this one?
Closing - will be handled in #3307 using usePreventScroll approach |
Closes #3474
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
Yes, as the tooltip when open it will stop scrolling.
📝 Additional Information
Summary by CodeRabbit
shouldBlockScroll
option to tooltips to control scrolling behavior, preventing accidental scrolling when the tooltip is open.