DOMException thrown when validating ui.text with type 'number'

Hello,

I have a ui.text view of type ‘number’ containing validations to make sure the number is greater than 0, and validateEvent is set to ‘key’. When I type “0” in the textbox, console show an exception:

Uncaught DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.

The problem is in webix.js, when function “setBottomText” tries to execute “setSelectionRange(this.getInputNode(), sel.start, sel.end)”. According to developer.mozilla.com:

Note that according to the WHATWG forms, spec selectionStart, selectionEnd properties and setSelectionRange method apply only to inputs of types text, search, URL, tel and password

So this basically means that everytime we have ui.text with type “number”, ther will be an exception thrown.

Here is the snippet to reproduce (just type 0 in the textbox and look at the console):
https://snippet.webix.com/6lf4d9n3

Is there any chance of this being fixed in a near future?

Thank you and have a nice day!
=o)

2 Likes

Hello,
This issue has been resolved in Webix version 10.3. If you’re using an earlier version, we recommend updating to the latest release to ensure the fix is applied.

2 Likes