Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Docs don't tell you about an important restriction on validators #23

Open
akc42 opened this issue Jul 21, 2016 · 0 comments
Open

Docs don't tell you about an important restriction on validators #23

akc42 opened this issue Jul 21, 2016 · 0 comments

Comments

@akc42
Copy link

akc42 commented Jul 21, 2016

I am trying to build a element which is the validator for a paper-input element contained within its template. The reason for this is the validation is a cross check between two input fields, and it is easier for the validator to refer to its own this.$ collection to get hold of the other elements to compare the one it is validating.

HOWEVER, the validator for an element (such as the paper-input I am taking about) is looked up using the computed property type as it itself is instantiated. At that point the "ready" function for the surrounding element has not yet fired, and so the validator itself is not registered. As a result, any attempt to validate the input field is in effect a no-op and it thinks its validator is undefined.

As I just responded to in #18 I can separate out the validator into a separate element and use some form of binding to connect the second element value as a parameter. The main issue I see is that there is no indication in any documents of this restriction.that an instance of the validator element has to exist. The way the validation works is that this lack of validator appears to be a successful validation, rather than a failure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant