-
-
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(components): popover closing issue in autocomplete with open modal #2494
Conversation
🦋 Changeset detectedLatest commit: aed650f The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@wingkwong 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 addresses a persistent issue found in the "@nextui-org/popover" package, specifically affecting the behavior of the Changes
Assessment against linked issues
Poem
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 Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .changeset/four-turtles-move.md (1 hunks)
- packages/components/popover/src/free-solo-popover.tsx (1 hunks)
Additional comments: 2
.changeset/four-turtles-move.md (1)
- 1-5: The changeset provides a clear indication of the patch update for the "@nextui-org/popover" package and succinctly describes the fix. However, it would be beneficial for users and developers if the description included more details about the specific changes made and how it impacts the functionality or usage of the
Autocomplete
component within modals. This additional information can help in understanding the context and significance of the update more thoroughly.packages/components/popover/src/free-solo-popover.tsx (1)
- 78-78: The update to the
shouldCloseOnInteractOutside
function to always returnfalse
is a direct approach to fixing the issue with the popover not closing when interacting outside of it in a modal context. This change appears to address the problem effectively. However, it's important to verify that this adjustment does not inadvertently affect other use cases of theFreeSoloPopover
component where closing the popover on outside interactions might still be desired. Testing or reviewing usage scenarios outside of the modal context would be beneficial to ensure that this change does not introduce new issues.
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.
Thank you! @wingkwong 🙏🏻
Still broken. Are there any workarounds? msedge_YZP0QasQj7.mp4browsers: package.json:
|
@Tosters We haven't released that yet - it should be in the next release. |
@wingkwong when is the next release? |
I updated to the latest version and it still seems broken |
📝 Description
shouldCloseOnInteractOutside
in FreeSoloPopoverallowsCustomValue
totrue
. This could temporarily make the popover close because it makes theinputRef.current
not to blur so that Autocomplete won't be re-rendered withisOpen = true
. However, this won't blur the input if the selection is empty (i.e. it'll stay focused).https://github.com/nextui-org/nextui/blob/2894aecca1a2ef0dfb3066b9b8df24ce48c99dae/packages/components/autocomplete/src/use-autocomplete.ts#L287-L291
⛳️ Current behavior (updates)
The popover can't be closed with open modal. See the above issue #2475 for the demo.
🚀 New behavior
nextui-pr2494-demo.webm
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Summary by CodeRabbit