Wj-input-number behavior with decimals

Posted by: itvendorinfo on 10 December 2020, 1:37 pm EST

  • Posted 10 December 2020, 1:37 pm EST

    In using the wj-input-number control in our application, our business / ux users have complained about how the control behaves with decimals.

    With a format=“c2”, as soon as you start typing it starts to add the 2 decimals and kind of jumps. I understand this is the design of the control, but I am having our product people saying they do not like this behavior.

    So, the question is, can we delay the formatting until a blur method somehow disable this automatic formatting. We like the formatting options, just not necessarily as the user is typing.

    They are viewing this via the demo here:

    https://www.grapecity.com/wijmo/demos/Input/InputNumber/Formatting/angular

    Mostly focused on the decimal (c2) but really would apply to any of them.

    This is the relevant code in the demo:

    
    <div class="container-fluid">
        <div *ngFor="let fmt of ['n0', 'n2', 'c0', 'c2', 'p0', 'p2']; index as i;" class="form-group">
            <label for="theInputNumberF{{i}}">{{fmt}}:</label>
            <wj-input-number id="theInputNumberF{{i}}" [format]="fmt"></wj-input-number>
        </div>
    </div>
    
    
  • Posted 11 December 2020, 7:14 am EST

    Hi,

    We are discussing this case with the dev team. The internal tracking id for the issue is 469837. We will keep you posted with updates regarding the same.

    Regards

  • Posted 18 December 2020, 3:28 am EST

    Hi,

    Devs have suggested setting the format to g12 when the control gets focus and set the format back to c2 after losing the focus. Please refer to the following sample demonstrating the same:

    https://codesandbox.io/s/wijmo-angular-forked-v9cmu?file=/src/app/app.component.ts

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels