Knockout-Contrib / Knockout-Contrib/Knockout-Validation

Controlled "deep" validation + observed find children

Open
#120 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1k
Forks
366
PR merge metrics
No merged PRs in 30d

Description

I have a couple of problems with the current validation engine:

  • I have circular references in my view model, so deep never ends.
  • I have a list of objects from which one can be chosen; only the chosen one should get validated
  • Since choosing the object (by setting an observable to one of the lists objects) the elements to validate in a group change - so it is not enough to just collect once...

I have a draft locally which fixes the first to problems by explicitly telling ko.validation which path to follow when validating. Currently this is done by extending with { followOnValidation: true }.

It will then also subscribe to those extended objects and update the "validatables" for the group correspondingly.

What do you think of that approach?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the current validation engine and reviewing the proposed local draft that uses followOnValidation. Reproduce the circular-reference and selectable-object cases, then verify that validation terminates, only the selected object is validated, and group validatables update when the selection changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.