SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
573 stars 42 forks source link

Feat: Duplicate Tags in TagInput Component #248

Closed maniravirala closed 3 days ago

maniravirala commented 5 days ago

Description

This pull request addresses the issue of duplicate tags being added in the TagInput component. A unique prop has been introduced to control whether duplicate tags should be allowed.

Related Issues

Fix #247

Changes

  1. Component Enhancement:

    • Added a new prop unique to the TagInput component.
    • Updated the keyword handling logic to prevent duplicates when unique is set to true.
  2. Keyword Addition:

    • When the Enter key or comma is pressed, the component adds the new keyword if it's not already present in the list.
    • Paste handling ensures that only unique keywords are added to the list when unique is set to true.

Key Features

Example Usage

<TagInput unique />

Screenshots

Before:

image

After:

image

vercel[bot] commented 5 days ago

@maniravirala is attempting to deploy a commit to the SyntaxUI Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 5 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
syntax-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 2:44pm
maniravirala commented 4 days ago

Check it once, I removed as you said

Ansub commented 3 days ago

Thank you for your valuable contribution to SyntaxUI! 🌟

Are you part of our SyntaxUI Discord community yet? • If yes, please reach out to me there – a special contributor badge awaits you! • If not, we'd love to have you join us. It's the perfect place to connect, share ideas, and stay updated on all things SyntaxUI.

Once again, thank you for helping shape the future of SyntaxUI. Your contribution makes a real difference! 💪✨