mi6 / mi6/ic-ui-kit

Parse error/warning labels when under 10 characters

Open
#1,483 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## Summary of the bug
As in the screenshot below, current validation messages use the variable from the prop (maxCharacters, maxValue etc in ic-text-field) which parses as a number in the message.

Good design says that any number below 10 should be in text format, ie 'The maximum characters is four', rather than, 'The maximum characters is 4'.

Suggest creating a helper function which can be used throughout the kit.

## 📸 Screenshots or code
textfieldexample
textfieldexample2

## 🧐 Expected behaviour
Values below 10 should parse as text instead on int

## Additional info
I have only investigated ic-text-field for this behaviour and it may need applying in other components.

Contributor guide

Open the contributing guide

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.

Research direction

Start by inspecting validation messages in ic-text-field, then check whether the same behavior appears in other components as the issue suggests. Trace how values such as maxCharacters and maxValue are formatted, and consider the proposed shared helper. Done means values below 10 are rendered as words consistently wherever these validation messages appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.