Skip to content

[vaadin-text-field] Consider removing maxlength attribute from input fields #7982

@knoobie

Description

@knoobie

Describe your motivation

I was thinking about applying maxlength from flow side to the fields.. but I stumpled upon the problem that it does not trigger server side validation as expexted and just trims copy paste.. won't let the user input more character than allowed and so on.. creating really bad UX..

More details why it's bad here: https://adamsilver.io/blog/dont-use-the-maxlength-attribute-to-stop-users-from-exceeding-the-limit/

Edit: You could even call it an accessibility problem - see https://www.tempertemper.net/blog/dont-meddle-with-user-input

Describe the solution you'd like

Adding maxlength to a field is announced to screen reader users, but users are not prevented to enter or copy paste more content into the field - the client should allow it and the server side should check and reject it correctly - WITH an error message.

Describe alternatives you've considered

Not using the feature - like always, just relying on StringLengthValidator by flow.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions