Browse Source

#2681 return length to functioning as minLength, add exact length

pull/2710/head
jlukic 9 years ago
parent
commit
208c9d6c59
2 changed files with 18 additions and 5 deletions
  1. 5
      RELEASE-NOTES.md
  2. 18
      src/definitions/behaviors/form.js

5
RELEASE-NOTES.md

@ -1,6 +1,11 @@
## RELEASE NOTES
### Version 2.0.6 - July x, 2015
**Important Notes**
- **Form Validation** - In `2.0.4` `length` rules were corrected to match "exact length" and not "minimum length". This may have caused issues for those who were using this rule as min length previously. This may have caused accidental breaking changes. We've remedied this in `2.0.6.` by returning `length` to functioning as "minimum length" and added a new rule `exactLenght` for matching exact length.
**[Reported Bugs](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.0.6+is%3Aclosed)**
- **Dropdown** - Fixed `restore value` sometimes now working correctly due to "animating out" label still being mistaken for selected.
- **Dropdown** - Added `set exactly` to remedy confusion of `set selected` not removing current selections with multiple

18
src/definitions/behaviors/form.js

@ -1191,22 +1191,30 @@ $.fn.form.settings = {
return (value.search( new RegExp(text) ) === -1);
},
// is exactly length
length: function(value, requiredLength) {
// is at least string length
minLength: function(value, requiredLength) {
return (value !== undefined)
? (value.length == requiredLength)
? (value.length >= requiredLength)
: false
;
},
// is at least string length
minLength: function(value, requiredLength) {
// see rls notes for 2.0.6 (this is a duplicate of minLength)
length: function(value, requiredLength) {
return (value !== undefined)
? (value.length >= requiredLength)
: false
;
},
// is exactly length
exactLength: function(value, requiredLength) {
return (value !== undefined)
? (value.length == requiredLength)
: false
;
},
// is less than length
maxLength: function(value, maxLength) {
return (value !== undefined)

Loading…
Cancel
Save