fonk icon indicating copy to clipboard operation
fonk copied to clipboard

Firing validations only when some DOM event type occurs

Open nasdan opened this issue 6 years ago • 0 comments

We would like to consume navite DOM event types and it only fires desired validations on that events.

Somethink like:

const validationSchema: ValidationSchema = {
  field: {
    login: [
      // fire validation only for change and blur events
      { validator: Validators.required.validator, events: ['change', 'blur'] }
    ],
    password: [
      // Fire validations for any event
      { validator: Validators.required.validator }
    ],
  }
}

DOM typings: search GlobalEventHandlersEventMap inside file.

nasdan avatar Sep 04 '19 16:09 nasdan