AlaskaAirlines / auro-input

Custom HTML element for inputting string data in forms
https://auro.alaskaair.com/components/auro/input
Apache License 2.0
2 stars 4 forks source link

validation event fires even if noValidate attribute is used #239

Closed jason-capsule42 closed 1 year ago

jason-capsule42 commented 1 year ago

Describe the bug

The validateMethod will not run the code that generates any validity state when using the noValidate attribute on the auro-input unless the error attribute is used to force an error state.

However, the validate() method still runs and fires the event saying it validated. It just skips over the actual validation logic using an if statement.

The event should only fire when that logic is executed or the element has a custom error defined using the error attribute.

To Reproduce

Steps to reproduce the behavior:

  1. Execute the input with the required and noValidate attribute set.
  2. use an eventListener for auroInput-validated
  3. focus and then blur the input

Expected behavior

The auroInput-validated should not fire