Skip to content

Commit

Permalink
Fix for client side 'required' validator which allowed whitespace to …
Browse files Browse the repository at this point in the history
…be submitted in input value. This library is now works the same way as jQuery Unobtrusive validation on which it is based.

Closes #109
  • Loading branch information
RyanONeill1970 committed May 7, 2024
1 parent fd1e5a6 commit 5b2129a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ export class MvcValidationProviders {

return false;
}
// Default behavior otherwise.
return Boolean(value);

// Default behavior otherwise (trim ensures whitespace only is not seen as valid).
return Boolean(value?.trim());
}

/**
Expand Down

0 comments on commit 5b2129a

Please sign in to comment.