Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Filter field: validation error is displayed while field is dirty #1180

Closed
pawel-bugalski-dynatrace opened this issue Jun 22, 2020 · 1 comment · Fixed by #1253
Closed

Filter field: validation error is displayed while field is dirty #1180

pawel-bugalski-dynatrace opened this issue Jun 22, 2020 · 1 comment · Fixed by #1253
Assignees
Labels
bug A broken behaviour that was working previously has-pr
Milestone

Comments

@pawel-bugalski-dynatrace

Bug Report

Expected Behavior

Error message should be displayed only once field is submitted.

Current Behavior

Error message is displayed for a split second while field is dirty.

Attachments

Example reproduction of an issue:
barista filter - blinking error.mov.zip
This reproduction was produced with verification example: https://stackblitz.com/github/dynatrace-oss/barista-examples/tree/master/examples/DtExampleFilterFieldValidator/?file=src%2Ffilter-field%2Ffilter-field-validator-example%2Ffilter-field-validator-example.ts
but using following data source:

export class DtExampleFilterFieldValidator {
  private DATA = {
    autocomplete: [
      {
        name: 'content',
        suggestions: [], validators: [
          { validatorFn: Validators.required, error: 'Content can not be empty.' },
        ],
      },
    ],
  };
  _dataSource = new DtFilterFieldDefaultDataSource(this.DATA);
}
@pawel-bugalski-dynatrace pawel-bugalski-dynatrace added the bug A broken behaviour that was working previously label Jun 22, 2020
@ffriedl89
Copy link
Collaborator

Thx @pawel-bugalski-dynatrace for reporting this issue.
It is actually intentional to display the error message once the field is dirty.

We show validation errors once the field is dirty and invalid - which means that the user interacted with it and there is an error

E.g. The user started typing in a required field (no error) - but then the user deletes the value (show error - since it was interacted with and its invalid due to the required validation)

But the flash of the error message once the user types the first character is a bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A broken behaviour that was working previously has-pr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants