Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

[HelperText] Purpose of both validation and isValidationMessage  #746

@dawsonc623

Description

@dawsonc623

I was reviewing the code related to validation messages with HelperText. It seems that when the setting the validation attribute, the React component adds the mdc-text-field-helper-text--validation-msg class to the list of classes added to the p created and rendered, while setting isValidationMessage triggers a process telling the foundation object it is for validation which in turn adds the mdc-text-field-helper-text--validation-msg class to a classList state that does not seem to be used at all.

Is there a reason isValidationMessage (or really, classList in general) exists? If not, the code and documentation should be updated to avoid confusion. This could be by getting rid of the local classes method and updating persistent to use the foundation as the other attributes do, or by gutting the use of the foundation object and keeping everything local. I am in favor of the former option since that keeps all of the class management logic in a place consistent with other wrapping frameworks (assuming they also use the foundation classes). I am happy to open a PR with whichever route is chosen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.bugSomething isn't workingtext-field

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions