Option to disable the counting of blank spaces and line breaks.

Created on 12 December 2023, about 1 year ago
Updated 1 February 2024, 11 months ago

Problem/Motivation

As seen in Issue πŸ› New lines and spaces are miscounted Fixed the counting of blank lines and blanks has given problems. Some of them have not been solved yet as you can see in the attached gif.

Remaining characters are 4 but I cant write anymore. User will not understand this.

Steps to reproduce

Do the same of the gif please.

Proposed resolution

There should be a check box that can be checked in the form submission settings to disable whitespace and line break counting. This would solve the problem for those who have this problem and don't care about the number of spaces or lines.

Remaining tasks

  • ❌ Get maintainer approval for the proposed resolution
  • ❌ Implement resolution
  • ❌ Write test coverage (contact a maintainer if you need help)
  • ❌ Maintainer review via the UI
  • ❌ Maintainer Code Review #1
  • ❌ Maintainer code review #2
  • ❌ Merge into dev branch, with credit to author and participants

User interface changes

Add a configuration page for Maxlength, with a setting to either count or not count line breaks and spaces.

API changes

Data model changes

✨ Feature request
Status

Closed: duplicate

Version

2.1

Component

Code

Created by

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

Comments & Activities

  • Issue created by @alejico
  • πŸ‡ΊπŸ‡ΈUnited States cedewey Denver, CO

    Hi alejico,

    Thank you for filing this issue. The current counting of blank spaces and line breaks as how the module is intended to work, so I'm updating this to be a feature request.

    If we were to implement this, do you envision this being a universal setting at a new Configuration page for MaxLength? That's what I'm envisioning as it would be confusing to an editor for the character limit functionality to behave differently between forms on the same site.

    Also, it seems that if we do this that there be one setting for counting line breaks and another for spaces. I can see an editor wanting to count space, but not line breaks, for example.

    Also, to be transparent, I'm not convinced this feature is in line with our values of:

    • helpful for authors
    • intuitive for site builders
    • sustainable for site owners
    • extendable for developers

    So we might not approve this feature request. We'll keep the discussion open for now though, to learn more from yourself and other community members on the value of this feature.

  • Hello cedewey,

    Yes, you are right, that has no sense.

    After analizing my problem a little more: It seems my problem with the remaining characters is only in the JS counter. It could be fixed if the counter would subtract the remaining characters with each keystroke and not with only letter. Then it would also count spaces and line breaks on the fly.

    As this has nothing to do with the title or the proposed solution, do you think I should modify the post (I don't know if I can because I still don't have the confirmed role) or create a new one?

    Thank you very much for taking the time to read this post.
    Alejandro.

  • πŸ‡ΊπŸ‡ΈUnited States cedewey Denver, CO

    Hi Alejandro,

    In that case this other issue sounds like the same problem you're experiencing - πŸ› Line break count is broken Active

    Is that right?

  • Hello Clayton,

    Sorry for the delay. In the end I made the decision not to use maxlength.js and make my own jquery.

    Yes, looks like similar problem. I will take a look since there is a patch for solution to try if solve my problem.

    Thank you!

  • Status changed to Closed: duplicate 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cedewey Denver, CO

    Thanks Alejandro. Since it's better for us to fix πŸ› Line break count is broken Active rather than add an extra configuration option, I'm going to close this and mark it as a duplicate.

Production build 0.71.5 2024