Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.
This repository was 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

@akc42

Description

@akc42

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions