setOptions on numericTextBox locks spinner

1 Answer 9 Views
NumericTextBox
Lee
Top achievements
Rank 1
Iron
Iron
Iron
Lee asked on 02 Sep 2022, 08:35 PM

When calling setOptions on the numericTextBox, the spinner locks up if there is a "factor" option set.

https://dojo.telerik.com/OYiYogis

See the above DoJo. Removing the factor seems to fix the issue, but I need the factor so that a user can type in 10 for 10% when the type is percentage but 10 for $10.00 when the type is currency. 

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 07 Sep 2022, 01:15 PM

Hello, Lee,

Thank you for the provided Dojo sample.

I tested the snippet with and without the factor option "set" and it seems to be broken in either case. I've logged an issue in our public GitHub repository and I've also updated your Telerik Points as a sign of gratitude for reporting this behavior.

Workaround

The problem occurs because the button click events are not reattached when the setOptions method is called. You can add the handlers back manually for now.

        numTextBox.setOptions({ value: numValue, format: "n3", decimals: 3, step: 0.001});

        numTextBox._upArrowEventHandler.bind("press", function(e) {
          e.preventDefault();
          numTextBox._spin(1);
          numTextBox._upArrow.addClass("k-selected");
        });

        numTextBox._downArrowEventHandler.bind("press", function(e) {
          e.preventDefault();
          numTextBox._spin(-1);
          numTextBox._downArrow.addClass("k-selected");
        });

Dojo

https://dojo.telerik.com/@gdenchev/EgadiroH 

I apologize about the caused inconvenience. Let me know if there's anything else I can do for you.

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 07 Sep 2022, 01:45 PM

Thank you for the workaround. 
Tags
NumericTextBox
Asked by
Lee
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Georgi Denchev
Telerik team
Share this question
or