Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "isModified(true) on change" behavior optional #578

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
341 changes: 188 additions & 153 deletions dist/knockout.validation.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/knockout.validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/knockout.validation.min.js.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@
ko.utils.arrayForEach(array, function (observable) {
// Do not collect validatedObservable errors
if (utils.isValidatable(observable) && !observable.isValid()) {
// Use peek because we don't want a dependency for 'error' property because it
// changes before 'isValid' does. (Issue #99)
errors.push(observable.error.peek());
errors.push(observable.error());
}
});
return errors;
Expand Down
1 change: 1 addition & 0 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var defaults = {
live: false //react to changes to observableArrays if observable === true
},
validate: {
setModifiedOnChange: true, // enables setting `isModified(true)` when observable changes
// throttle: 10
}
};
Expand Down
Loading