Skip to content

[TagsInput] Allow duplicates #2927

@xkadl17

Description

@xkadl17

🚀 Feature request

Current documentation says that if you want to disallow duplicates in TagsInput, you can use validate function prop to implement logic for such case. Unfortunately I found in the Zag repo code that it actually uses uniq internally to remove any duplicates when adding new value. Would it be possible to have either this "default" solution removed or add a prop to allow duplicates? This should also work then for pasting the values. We need it for our company internal DS.

Code issue in packages/machines/tags-input/src/tags-input.machine.ts:
https://github.com/chakra-ui/zag/blob/main/packages/machines/tags-input/src/tags-input.machine.ts#L615

Image

🧱 Problem Statement / Justification

We need an option to allow duplicates to be used.

✅ Proposed solution or API

Either remove the use of uniq or add a prop to allowDuplicates

Thank you for the great work in Zag/Ark/Panda <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions