Number fields show error after entering - sign, before leaving field (Enketo)

Description

When you enter a minus sign in an integer or decimal field, an error pops up at once.

Steps to Reproduce

  1. Use XLSForm attached
    numMinus.xlsx (9.7 KB)

  2. Enter - (minus sign) in Score 01 field and wait a moment (without move/action/click) > error shows up.

  3. Enter - in Score 02 Dec field and wait a moment > error shows up.

Add digits after the minus >> this error will disappear.

Expected behavior

Error should not show up during entering in field.

  • on first position should be allowed during entering.

Actual behavior

See above and screenshot.
image

Additional details

ODK Online validator Preview, Windows 10, newest Chrome version.
Same behaviour in (newest) Firefox and KoboToolbox Preview and deploy/open.

@wroos, I also did a quick check and was able to enter a negative digit. FYR:

I observed that if you put a minus sign, the system will return an error message. But if you input a negative number, it will accept it.

Sorry, I think this is not a “solution” . The problem is that directly after entering a minus sign stiill with focus in the field an error message appears.
So, if you enter slowly -24, you will get an error before the 2 (with focus still in field).

This seems strange as an error appears during editing/focus in the field. This may also confuse a user (slowly typing),. if negative numbers are allowed.

The normal control behaviour in Kobo is, a far as we experienced: either you cannot enter invalid elements (e.g. letters in number field) or the error is shown after the field lost focus, but not before.

@Kal_Lam, could we get a developper feedback too, please.

@wroos, pinging @Xiphware here. Maybe he could also make improvements (if needed).

1 Like