Skip to content

Conversation

KazimirPodolski
Copy link

πŸ”— Linked issue

Resolves #5161

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Adds missing close prop to all Popover slots.

Popover uses either Reka Popover or Reka HoverCard depending on mode, and since HoverCard doesn't provide close, it will be undefined in mode="hover". I reflected it in documentation. Please tell if you want me to properly reflect in in the types too (probably should be done via a generic parameter inferring mode extends 'click' or something).

I did not touch tests as similar stuff in Modal is not tested, but I did check it locally in my project before commiting.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions bot added the v4 #4488 label Oct 6, 2025
Copy link

pkg-pr-new bot commented Oct 6, 2025

npm i https://pkg.pr.new/@nuxt/ui@5176

commit: 742fbaa

@benjamincanac benjamincanac changed the title feat(Popover): add close prop to Popover slots feat(Popover): add close method in slots Oct 7, 2025
@benjamincanac
Copy link
Member

Oh yes indeed, we could use a generic on mode to properly type the slot props. Let me know if you want to do it otherwise we can merge as-is.

@KazimirPodolski
Copy link
Author

Ok I think I've got it somewhat acceptable. Didn't manage to make TS to type Component.Root perfectly clean, but at least it compiles and gives the correct types on usage:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 #4488
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add close method to UPopover's slots
2 participants