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

Filter field: required validation not being for the first time #1299

Closed
sebapawlak opened this issue Jul 16, 2020 · 1 comment · Fixed by #1302
Closed

Filter field: required validation not being for the first time #1299

sebapawlak opened this issue Jul 16, 2020 · 1 comment · Fixed by #1302
Assignees
Labels
bug A broken behaviour that was working previously has-pr

Comments

@sebapawlak
Copy link

sebapawlak commented Jul 16, 2020

Bug Report

For the filter field component Validators.required validation is not being triggered when a filter is selected and no value for the filter is provided. Likely caused by fix for #1180

When some value is typed and then deleted then it gets properly validated and a validation error is shown.

Expected Behavior

When there is a validation that requires value and after the selection of the filter it gets submitted there should be a validation error.

Current Behavior

There is no validation error shown if the page is submitted right after a filter with Validators.required validation is selected.

Steps to Reproduce

Data source to reproduce the issue:

{
    autocomplete: [
      {
        name: 'nonEmptyFreeText',
        suggestions: [],
        validators: [
            {validatorFn: (control: FormControl) => Validators.required(control), error: 'Content cannot be empty.'},
          ],
      },
    ],
}
  1. Select nonEmptyFreeText filter.
  2. Hit return key.
  3. Validation error should be shown at this point.

Used Versions:

Issue does not exist in Barista 7.2.0.
Issue identified in Bartista 7.4.0 but 7.3.0 was not checked.

@sebapawlak sebapawlak added the bug A broken behaviour that was working previously label Jul 16, 2020
@tomheller tomheller self-assigned this Jul 16, 2020
tomheller added a commit that referenced this issue Jul 16, 2020
@tomheller
Copy link
Collaborator

@sebapawlak Thank you for reporting this. I can confirm that this is an issue caused by the fix contained in #1180.

tomheller added a commit that referenced this issue Jul 20, 2020
github-actions bot pushed a commit that referenced this issue Jul 20, 2020
github-actions bot pushed a commit that referenced this issue Jul 20, 2020
yngrdyn pushed a commit to yngrdyn/barista that referenced this issue Nov 9, 2020
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
2 participants