Skip to content

feat(input): character count indicator#1731

Open
cooper-joe wants to merge 1 commit intomasterfrom
LIBS-531-input-counter
Open

feat(input): character count indicator#1731
cooper-joe wants to merge 1 commit intomasterfrom
LIBS-531-input-counter

Conversation

@cooper-joe
Copy link
Member

@cooper-joe cooper-joe commented Mar 24, 2026

Implements LIBS-531


Description

This PR adds a character count indicator to the Input component. The counter is information only so the prop is named characterCountLimit rather than the native <input>'s maxLength, which is actually enforced.

There is some complexity to the way an Input with both characterCountLimit and clearable display the end-aligned items. To avoid changing the existing implementation, the additional flex layout element is only used when both characterCountLimit and clearable are present (which is not an expected common use case).

I considered linking the character limit to the input's error prop, but for now validation remains the responsibility of the consumer.


Checklist

  • API docs are generated
  • Tests were added
  • Storybook demos were added

All points above should be relevant for feature PRs. For bugfixes, some points might not be relevant. In that case, just check them anyway to signal the work is done.


Screenshots

image image image

@cooper-joe cooper-joe requested a review from a team as a code owner March 24, 2026 12:42
@cooper-joe
Copy link
Member Author

Failing test appears to be unrelated.

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Mar 24, 2026

🚀 Deployed on https://pr-1731--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify March 24, 2026 12:45 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify March 24, 2026 19:03 Inactive
@cooper-joe cooper-joe force-pushed the LIBS-531-input-counter branch from 4ed9a04 to 680edb2 Compare March 26, 2026 18:37
@dhis2-bot dhis2-bot temporarily deployed to netlify March 26, 2026 18:40 Inactive
@cooper-joe cooper-joe force-pushed the LIBS-531-input-counter branch from 680edb2 to 85531f6 Compare March 27, 2026 12:17
@sonarqubecloud
Copy link

@dhis2-bot dhis2-bot temporarily deployed to netlify March 27, 2026 12:20 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants