Array members uniqueness

Open
#337 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api, content

Research direction

Start by tracing the fields.array entry point used in the documented fields.text example and inspect how array values are currently created and validated. Clarify the intended duplicate-value semantics and whether the option belongs in the field API or editor behavior. Done means the chosen uniqueness behavior is supported and covered by relevant tests.

Written by the indexing model from the issue text.

Description

enhancement

I don't know is this is a bug or a feature, but given the example from the docs, keystatic doesn't prevent creating duplicated values.

tags: fields.array(
  fields.text({ label: 'Tag' }),
  // Labelling options
  {
    label: 'Tag',
    itemLabel: props => props.value
  }
)

Could be an option like { unique: true }

Dominant language
TypeScript
Stars
2.4k
Forks
159
Avg merge
21h 41m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Thinkmill/keystatic

All issues in Thinkmill/keystatic

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.