Custom Query (18300 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (103 - 105 of 18300)

Ticket Resolution Summary Owner Reporter
#18563 fixed NumberTextBox doesn't fill trailing zeros when using constraints: {places: 2} Bill Keese <[email protected]…> Michael Schall
Description

The NumberTextBox? (and children) require the user to enter trailing zeros to fulfill the number of "places" is specified. For the CurrencyTextBox?, the places is add for you by the setting currency attribute (i.e. currency: 'USD'). An example showing constraints with places set available on ​jsFiddle.

This means that a widget setup like the following

<input type="text" data-dojo-type="dijit/form/NumberTextBox"
    data-dojo-props="constraints:{places:2}" value="0" />

Has has the following issues:

  • 1 is not formatted to 1.00 on blur and shows a validation
  • 1.1 is not formatted to 1.10 on blur and shows a validation

Both of these work if you just use {pattern:'##0.00'}. As mentioned, CurrencyTextBox? forces a places, so that is not an option. The places setting also gives immediate validation when you go over the desired length which is very nice for the user.

I think I have resolved the issues with the following changes:

  • NumberTextBox.js

     
    179179                        if(this.editOptions && this.focused && isNaN(v)){
    180180                                v = this._parser(value, constraints); // parse w/o editOptions: not technically needed but is nice for the user
    181181                        }
     182                        if (!this.focused && isNaN(v)  && constraints.places != null  /* or undefined */) {
     183                                var maxPlaces = Number(constraints.places.toString().split(",").pop()); // handle number and range
     184                                v = this._parser(value, lang.mixin({}, constraints, { places: "0," + maxPlaces }));
     185                        }
    182186                        return v;
    183187                },
    184188
     
    211214                },
    212215
    213216                _setBlurValue: function(){
    214                         var val = lang.hitch(lang.delegate(this, { focused: true }), "get")('value'); // parse with editOptions
     217                        var val = this.get('value');
    215218                        this._setValueAttr(val, true);
    216219                },

The risk here is changing the _setBlurValue to get the value as "focused: false". I'm sure it was done this way for a reason, but I'm not sure why we would want to parse as focused on blur anyway. I'm sure I'm missing something. Another option is to pass an inBlur flag along to resolve the issue like the following change:

  • NumberTextBox.js

     
    179179                        if(this.editOptions && this.focused && isNaN(v)){
    180180                                v = this._parser(value, constraints); // parse w/o editOptions: not technically needed but is nice for the user
    181181                        }
     182                        if (this.inBlur && isNaN(v) && constraints.places != null  /* or undefined */) {
     183                                var maxPlaces = Number(constraints.places.toString().split(",").pop()); // handle number and range
     184                                v = this._parser(value, lang.mixin({}, constraints, { places: "0," + maxPlaces }));
     185                        }
    182186                        return v;
    183187                },
    184188
     
    211214                },
    212215
    213216                _setBlurValue: function(){
    214                         var val = lang.hitch(lang.delegate(this, { focused: true }), "get")('value'); // parse with editOptions
     217                        var val = lang.hitch(lang.delegate(this, { focused: true, inBlur: true }), "get")('value'); // parse with editOptions
    215218                        this._setValueAttr(val, true);
    216219                },

This change makes entering numbers more user friendly across all NumberTextBoxes?.

#18715 fixed dijit/Editor on IE11 can't enter text if "Active Scripting" is disabled for the "Internet" zone in IE Bill Keese <[email protected]…> andiby
Description

This is the same issue as #16633, but for IE11. For IE9 it was fixed with this condition in dijit/_editor/RichText:

if(has("ie") == 9){
        // On IE9, attach to document before setting the content, to avoid problem w/iframe running in
        // wrong security context, see #16633.
        this.editingArea.appendChild(ifr);
        ifr.src = s;
}else{
        // For other browsers, set src first, especially for IE6/7 where attaching first gives a warning on
        // https:// about "this page contains secure and insecure items, do you want to view both?"
        ifr.setAttribute('src', s);
        this.editingArea.appendChild(ifr);
}

In IE10 this issue does not happen. So when I add IE11 to the condition, it works for me in IE11 with http and https URLs:

if(has("ie") == 9 || has("trident") == 7"){
#18720 fixed Editor broken on Edge Bill Keese <[email protected]…> bill
Description

For example, highlighting a word and then clicking the "bold" button doesn't work.

Also, in an empty editor, pressing the [123] icon correctly starts a numbered list, and things work fine typing the first item and hitting return, but then when you type the second item it inserts an extra newline, and then when you hit return it doesn't start a new item:

1. item 1
2.
   item 2
   item 3

Also, when you hit the icon to center the current paragraph, it centers all the text. Tested on test_Editor.html

Note: See TracQuery for help on using queries.