Counter Maximum JS does not match validation

Created on 11 May 2020, over 4 years ago
Updated 20 February 2024, 9 months ago

Text Field set to 1000 characters max.
In page I see 0 character(s) remaining.
When I go to save I get error
'Additional details for accepted applicants: cannot be longer than 1000 characters but is currently 1004 characters long.'

It believe that line breaks are counted as 1 character by JS and 2 characters by validation script.

🐛 Bug report
Status

Fixed

Version

5.11

Component

Code

Created by

🇨🇦Canada gord.fisch

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Hi guys,

    This patch causes an error of minus counter because line break counts as 2 characters but we can still type inside the textarea until it has the specified amount of characters as is the line break counts as 1 character.

    For example I insert 10 line break, and type as many characters as I want, and after it hit , it then prevent me from typing.

    -10 character(s) remaining

    I suggest to change stopInputAtMaximum into true,

    {
              stopInputAtMaximum: true,
    }
Production build 0.71.5 2024