Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value is not displayed if pattern is invalid #229

Open
zmoore-alaskaair opened this issue Feb 7, 2023 · 2 comments
Open

Value is not displayed if pattern is invalid #229

zmoore-alaskaair opened this issue Feb 7, 2023 · 2 comments

Comments

@zmoore-alaskaair
Copy link

zmoore-alaskaair commented Feb 7, 2023

Describe the bug

When an auro-input element has a value, but the pattern property is not valid regex, the value will not be rendered.

To Reproduce

Make an auro-input with an invalid regex pattern.
[a-zA-Z0-9]{9, 25} note space between length constraints

Expected behavior

Perhaps a different error, or some other notification mechanism when this happens. I would expect the value to always be displayed if it's present, regardless of whether or not it matches the pattern.

Screenshots

Invalid regex [a-zA-Z0-9]{9, 25}:
image

Valid regex [a-zA-Z0-9]{9,25} (no space between length constraints):
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 109

Smartphone (please complete the following information):

Untested

Additional context

Perhaps a separate issue, but the validateInputAttributes method of the base-input doesn't document that you can only use the pattern, or the length attributes, but not both. The pattern gets evaluated first as the if in an if-elseif-elseif.

@zmoore-alaskaair zmoore-alaskaair added auro-input not-reviewed Issue has not been reviewed by Auro team members Type: Bug Bug or Bug fixes labels Feb 7, 2023
@blackfalcon blackfalcon removed their assignment Mar 21, 2023
@blackfalcon blackfalcon added Type: Feature New Feature and removed Type: Bug Bug or Bug fixes labels Mar 21, 2023
@blackfalcon
Copy link
Member

The issue you are describing isn't a bug per-say as the element is working as intended. If I understand this correctly, you are looking for a new feature that evaluates the accuracy of the regex?

@Patrick-Daly-AA
Copy link

When this is picked up, please compare to behavior of standard HTML input fields to inform our path forward.

@jordanjones243 jordanjones243 self-assigned this Apr 8, 2024
@jason-capsule42 jason-capsule42 removed Type: Feature New Feature not-reviewed Issue has not been reviewed by Auro team members labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants