Skip to content

feat(Drawer): add programmatic close functionality to drawer from dialog-root#106

Open
JosephAnson wants to merge 2 commits intounovue:mainfrom
JosephAnson:feat/support-scoped-close
Open

feat(Drawer): add programmatic close functionality to drawer from dialog-root#106
JosephAnson wants to merge 2 commits intounovue:mainfrom
JosephAnson:feat/support-scoped-close

Conversation

@JosephAnson
Copy link
Copy Markdown

🔗 Linked issue

I've made this PR to help support the change to NuxtUI, as it would reduce the amount of internal state needed: nuxt/ui#4219

❓ 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

Implemented programmatic close method for both DrawerRoot and DrawerRootNested component.

New Feature:

  • Programmatic close method - DrawerRoot and DrawerRootNested now exposes a close method through the #default scoped slot, allowing drawers to be closed from within their content without requiring external ref management.

Documentation Updates:

  • Shows both ways to close Drawer in README.md
  • Updated the playground to include a navigation to explore the different examples easier.

Benefits:

  • No need to create and manage boolean refs for modal state
  • Reduces boilerplate code and cognitive load

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 27, 2025

🦋 Changeset detected

Latest commit: 4cf9a72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vaul-vue Patch

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

@JosephAnson JosephAnson force-pushed the feat/support-scoped-close branch from ddc618a to 4cf9a72 Compare May 27, 2025 22:54
@JosephAnson JosephAnson changed the title feat(Drawer): add programmatic close functionality to drawer from dia… feat(Drawer): add programmatic close functionality to drawer from dialog-root May 28, 2025
@JosephAnson
Copy link
Copy Markdown
Author

Hey @zernonia any chance you could have a quick look at this PR, so we can implement the changes in Nuxt UI? Thanks bud

metkm added a commit to metkm/vaul-vue that referenced this pull request Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant