Skip to content

Commit 7da17f7

Browse files
authored
feat(form): support shouldtrim per fieldrule
This PR adds support to use the form wide shouldTrim setting individually per field rule
1 parent 1b7159a commit 7da17f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/definitions/behaviors/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ $.fn.form = function(parameters) {
13151315
// cast to string avoiding encoding special values
13161316
value = (value === undefined || value === '' || value === null)
13171317
? ''
1318-
: (settings.shouldTrim) ? String(value + '').trim() : String(value + '')
1318+
: (settings.shouldTrim && rule.shouldTrim !== false) || rule.shouldTrim ? String(value + '').trim() : String(value + '')
13191319
;
13201320
return ruleFunction.call(field, value, ancillary, $module);
13211321
}

0 commit comments

Comments
 (0)