Maxlength not works when adding "<" in the field

Created on 8 October 2024, 7 months ago

Steps to reproduce -

Content type with the plain textfield
Add the maxlength to the field
Enter the maximum value text in form
and then enter "<" and try to add more

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇮🇳India joshi.rohit100 Delhi, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joshi.rohit100
  • Pipeline finished with Success
    7 months ago
    Total: 346s
    #303810
  • 🇮🇳India diwakar07

    Hi @joshi.rohit100,
    I tried to reproduce the issue.
    So, whenever adding a "<" without the respective ">", maxlength counter tried to add a closing tag(), but was skipping to close the previously opened "<" tag.
    Updated the JS to add the ">" in case there is an open "<".
    Now the counter looks good to me.
    HTML tags are not considered as characters.

    Please review.

  • 🇧🇪Belgium joevagyok

    Thank you for the contribution.
    Please add a test case functional test case to validate we actually have the issue and preferably the fix in a separate commit to show it fixes the problem.

  • Status changed to Needs work 3 days ago
  • 🇮🇳India er.garg.karan Chandigarh

    I am also facing this issue.

    Imposed hard limit of 7 characters.
    Tried adding <7chars to the field.

    As soon, I type the 8th key (could be an integer, alphabet, any special character), maxlength.js adds unnecessary characters on its own. So, if I type "a", it automatically changes it to become <7charsa></7charsa>

    BTW, diwakar07 , your fix didn't work for me.

Production build 0.71.5 2024