Topic: Character counter in input fields fails with Unicode characters

Checho Man priority asked 10 months ago


Expected behavior

14 characters

Actual behavior

17 characters

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/docs/standard/forms/input-fields/#section-character-counter

code

<div class="form-outline">
  <input type="text" id="form16" class="form-control" data-mdb-showcounter="true" maxlength="64" />
  <label class="form-label" for="form16">SomeLabel</label>
  <div class="form-helper"></div>
</div>

Text used:

SomeText🐘🐘🚷End

Example


Michał Duszak staff answered 10 months ago


This is correct behaviour, as emojis consist of two unicode characters.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.2
  • Device: Laptop intel i7
  • Browser: Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes