Opened 7 years ago

Closed 7 years ago

#18466 closed defect (fixed)

CurrencyTextBox does not warn on leading spaces when entering a number (French local)

Reported by: Clement Mathieu Owned by: Clement Mathieu
Priority: high Milestone: 1.9.8
Component: Dijit - Form Version: 1.9.7
Keywords: Cc:
Blocked By: Blocking:


In English local you can't start a number in CurrencyTextBox? with a space.

In French local you can. However there is no reason for that. Leading spaces are not correct in French.

Here is a sample to reproduce the issue:

    <style type="text/css">
        @import "themes/claro/claro.css";
    <script type="text/javascript"
        data-dojo-config="isDebug: false, async: true, parseOnLoad: true, locale:'fr-fr'"
            "dijit/form/CurrencyTextBox"], function(parser, CurrencyTextBox) {
    <input type="text" data-dojo-type="dijit/form/CurrencyTextBox"

Change History (4)

comment:1 Changed 7 years ago by cjolif

Owner: set to Clement Mathieu
Priority: undecidedlow
Status: newassigned

comment:2 Changed 7 years ago by cjolif

Priority: lowhigh

comment:3 Changed 7 years ago by Clement Mathieu

After investigating this, I think the problem lies into the regexp generation function in dojo/number.js.

Especially, is problematic. If the currency pattern from cldr contains a space before or after the currency symbol, those spaces will be matched by the regexp even if the symbol is undefined (like when there is no currency constraint on the CurrencyTextBox).

A potential fix can be found in

Version 1, edited 7 years ago by Clement Mathieu (previous) (next) (diff)

comment:4 Changed 7 years ago by cjolif

Milestone: tbd1.9.8
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.