spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: textfields with patterns should be able to validate positively and negatively independently

Open hunterloftis opened this issue 4 years ago • 0 comments

Code of conduct

  • [X] I agree to follow this project's code of conduct.

Impacted component(s)

sp-textfield

Expected behavior

A textfield with a validation pattern should be able to:

  1. display no validation icons
  2. display positive validation icons ("yes, that looks like an email address")
  3. display negative validation icons ("slashes are invalid in filenames")
  4. display both positive and negative validation icons (default)

From the spec:

Text fields can display a validation icon when the text entry is expected to conform to a specific format

A text field can be marked as having an error to show that a value needs to be entered in order to move forward or that a value that was entered is invalid

Actual behavior

Currently, both positive and negative validation icons are always displayed (one at a time, depending on state) for textfields with validation patterns.

Screenshots

https://user-images.githubusercontent.com/364501/136239879-c996fb1e-2da2-4c76-83db-0e3742898c2a.mov

What browsers are you seeing the problem in?

No response

How can we reproduce this issue?

No response

Sample code that illustrates the problem

We should extend the API to support validation-visibility="positive / negative / none", showing both types of validation as the default when unspecified.

Logs taken while reproducing problem

No response

hunterloftis avatar Oct 06 '21 15:10 hunterloftis