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
806 stars 52 forks source link

Fix for Duplicate Tags in TagInput Component #247

Closed maniravirala closed 3 months ago

maniravirala commented 3 months ago

Pull Request: Fix for Duplicate Tags in TagInput Component

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 Issue

Fixes #246

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.

Screenshots

Before:

image

After:

image

Key Features

Example Usage


<TagInput unique />
vercel[bot] commented 3 months ago

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

A member of the Team first needs to authorize it.

Ansub commented 3 months ago

Why there are so many changes in package lock json?

maniravirala commented 3 months ago

I will raise another PR, I did a small mistake