Skip to content

Commit

Permalink
Allow "0." to be typed in to a text widget (#1360)
Browse files Browse the repository at this point in the history
* fix: allow "0." to be typed in

* Fix expected value of input in test for NumberField (#1361)

* test: add tests
  • Loading branch information
epicfaace authored Aug 10, 2019
1 parent ab5623f commit 20ff3b9
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 217 deletions.
2 changes: 1 addition & 1 deletion src/components/fields/NumberField.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class NumberField extends React.Component {

let value = formData;

if (typeof lastValue === "string" && value) {
if (typeof lastValue === "string" && typeof value === "number") {
// Construct a regular expression that checks for a string that consists
// of the formData value suffixed with zero or one '.' characters and zero
// or more '0' characters
Expand Down
Loading

0 comments on commit 20ff3b9

Please sign in to comment.