You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inputElement property is currently defined as HTMLElement, which is a type that represents any HTML element. However, in most of the components, this property is expected to reference an <input> or <textarea> exclusively. As a result, developers are required to cast this property to the more specific HTMLInputElement or HTMLTextAreaElement whenever they want to get access to input-specific properties like value, for example to check if the field has bad input.
Describe the solution you'd like
The inputElement property could have a more specific type based on the component:
HTMLInputElement for components like text-field, date-picker, etc
HTMLTextAreaElement for components like text-area
HTMLElement (current type) for components like date-picker-light, etc
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
vursen
changed the title
Make inputElement property type more specific to eliminate unnecessary casting
Make inputElement type more specific to eliminate unnecessary casting
Sep 27, 2024
Describe your motivation
The
inputElement
property is currently defined asHTMLElement
, which is a type that represents any HTML element. However, in most of the components, this property is expected to reference an<input>
or<textarea>
exclusively. As a result, developers are required to cast this property to the more specificHTMLInputElement
orHTMLTextAreaElement
whenever they want to get access to input-specific properties likevalue
, for example to check if the field has bad input.Describe the solution you'd like
The
inputElement
property could have a more specific type based on the component:HTMLInputElement
for components liketext-field
,date-picker
, etcHTMLTextAreaElement
for components liketext-area
HTMLElement
(current type) for components likedate-picker-light
, etcDescribe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: