Skip to content

Commit

Permalink
fix: pass rawValue to validate function
Browse files Browse the repository at this point in the history
  • Loading branch information
Darío Javier Cravero committed Sep 16, 2019
1 parent ac362d4 commit e739e89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ensure-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ export let useCaptureItem = ({
return {};
}
let value = format.in(get(item, path));
let rawValue = get(item, path);
let value = format.in(rawValue);
let isValid =
validate && (touched.current || (required && item._forceRequired))
? fromValidate[validate](value)
? fromValidate[validate](rawValue, value)
: true;
let onChange = value => {
touched.current = true;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@viewstools/morph",
"version": "19.10.3",
"version": "19.10.4",
"description": "Views language morpher",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit e739e89

Please sign in to comment.