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

auro-input: add "auro-input" attribute if element has registered under a custom name #267

Closed jason-capsule42 closed 1 year ago

jason-capsule42 commented 1 year ago

Is your feature request related to a problem? Please describe.

Validation of components that use auro-input need to be able to queryselector the input correctly. In order to find the correct element when named custom there needs to be a common selector string known to the validation code.

Describe the solution you'd like

When this.tagName.toLowerCase() !== 'auro-input' add auro-input as an attribute on the element.

Describe alternatives you've considered

Components like Datepicker and Combobox could apply the attribute themselves. However, I feel this is something that could be easily forgotten during development of a new component that needs to do the same work. I believe it's easier to just have auro-input handle this.

Additional context

No response