Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa516beb authored by Romain Guy's avatar Romain Guy
Browse files

Correctly validate numbers when pasted in NumberPicker.

Bug #2258525
parent 9277c6d9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -473,10 +473,13 @@ public class NumberPicker extends LinearLayout {

    private int getSelectedPos(String str) {
        if (mDisplayedValues == null) {
            try {
                return Integer.parseInt(str);
            } catch (NumberFormatException e) {
                /* Ignore as if it's not a number we don't care */
            }
        } else {
            for (int i = 0; i < mDisplayedValues.length; i++) {

                /* Don't force the user to type in jan when ja will do */
                str = str.toLowerCase();
                if (mDisplayedValues[i].toLowerCase().startsWith(str)) {