Skip to content

input :valid & :invalid pseudo-classes not being set appropriately #836

@oskanberg

Description

@oskanberg

Expected Behaviour

The CSS3 :valid and :invalid pseudo-classes are applied correctly when using Angular in-built form validation. CSS rules that apply to these elements work out of the box for angular forms that are using .ng-valid and .ng-invalid. I would expect angular-schema-form to manage these states correctly too.

Actual Behaviour

When using input validation with angular-schema-form, inputs appear to always be :valid, even if a field is invalid.

To demonstrate, see the basic form on schemaform.io.

  1. Cause the validation on any of the fields to fail.
  2. Call $('input:valid') in the developer console.
  3. Observe that the invalid (with .ng-invalid) is still returned.

Unfortunately this means that CSS frameworks that require :valid, :invalid states are not natively supported by angular-schema-form.

I am happy to tackle this issue if someone can point me in the right direction.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions