Knockout-Contrib / Knockout-Contrib/Knockout-Validation
Support live option for observable objects
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 366
- PR merge metrics
- No merged PRs in 30d
Description
I have some properties that contain 0 or 1 items that either start as null or can change their instance in the future. These properties are not included in the validation even when live is true.
Currently I'm using the following as a work around:
``` javascript
this.valueForValidation = ko.observableArray([null]);
this.value = ko.computed({
read: function() { return this.valueForValidation()[0]; },
write: function(value) { this.valueForValidation([value]); },
owner: this
});
```
Contributor guide
Research direction
No file or test is named. Start by tracing how the validation library handles the `live` option for observable arrays and computed properties, using the workaround as a behavioral example. Done means observable properties that start as null or later change instance are included in validation when `live` is true, with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100