[MainUI] fix type "number" for list separator in Designer #950
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #949
After changing the separator type to
text
it works as intended but there was one problem in following use case: when you need a space' '
as separator character/string, theupdateParameter
method interprets it as a non-NaN value (sinceisNaN(' ')
isfalse
) and resultet in aNaN
as input string. (This also occurs on other text inputs when you type a space, like url, refresh, frequency, ...)I tought about two ways to solve this:
type="number"
(like in the second commit)isNaN(parseFloat(value))
instead ofisNaN(value)
, sinceparseFloat(' ') === NaN
so the check would work. This way had one problem when the number of space characters is important becauseparseFloat(' 1') === 1
and this will trim leading whitespaces of the input.