Skip to content

Add character count in text area - #1972

Open
shravani-0811 wants to merge 2 commits into
masterfrom
text-char-count
Open

shravani-0811 wants to merge 2 commits into
masterfrom
text-char-count

Conversation

@shravani-0811

@shravani-0811 shravani-0811 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Enhancing the text area to show the character count.

Related Issue

https://jira.corp.adobe.com/browse/FORMS-13475

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

1 similar comment
@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

1 similar comment
@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
target-size serious

public static final String PN_SHOW_AS_POPUP = "showAsPopup";
public static final String PN_TEXT_IS_RICH = "textIsRich";
public static final String PN_MULTILINE = "multiLine";
public static final String PN_SHOW_CHARACTER_COUNT = "showCharacterCount";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace this with fd: and this also needs to be implemented in headless for text area

*
* @return {@code true} if the character count should be shown, {@code false} if not, or {@code null} if not configured or
* not applicable
* @since com.adobe.cq.forms.core.components.models.form 5.13.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this version should be as per the current package.info file

"required",
"rules",
"screenReaderText",
"showCharacterCount",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not right, any schema changes should go via af2-docs repo which is inside git corp, revert.

Also this is a custom property, so it should not be part of the spec as well (only OOTB properties are part of the spec)

textarea.cmp-adaptiveform-textinput__widget {
height: @textarea-height;
}
.cmp-adaptiveform-textinput__charcount {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't give color in OOTB less file, it should come via theme. This should just drive basic usability of the feature

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[EDIT] looks like this is in examples, so we are good

// "Show character count" is only applicable to multi line fields; hidden until "Allow multiple lines" is checked
cy.get(".cmp-adaptiveform-textinput__showcharactercount").parent('div').invoke('css', 'display').should('equal', 'none');
cy.get("[name='./multiLine']").click({force: true});
cy.get(".cmp-adaptiveform-textinput__showcharactercount").parent('div').invoke('css', 'display').should('equal', 'block');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add runtime test case ? Also in authoring, char count won't work and it would display 0/max length, even that test needs to be added

@rismehta rismehta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comments

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.

3 participants