Skip to content

Commit 36a24f1

Browse files
authored
Merge pull request #112 from RyanONeill1970/main
Fix for client side 'required' validator which allowed whitespace
2 parents fd1e5a6 + 5b2129a commit 36a24f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ export class MvcValidationProviders {
153153

154154
return false;
155155
}
156-
// Default behavior otherwise.
157-
return Boolean(value);
156+
157+
// Default behavior otherwise (trim ensures whitespace only is not seen as valid).
158+
return Boolean(value?.trim());
158159
}
159160

160161
/**

0 commit comments

Comments
 (0)