Rename <formControl>.form to associatedForm #122
Replies: 1 comment 5 replies
-
🤔 I thought I had changed this.
slightly different from the platform, but slightly more convenient to be able to set the form with a string, and tends to play nicer with frameworks that only understand properties and not attributes. Dont know how other feels about the "polymorphic" API, but I think I may have walked it back for fear of it being confusing 🤔 @LeaVerou / @claviska would love your thoughts on making it a getter / setter like above. But I do agree |
Beta Was this translation helpful? Give feedback.
-
Currently, form controls have an optional
form
property to set the ID of the associated form. Native form controls also have a read-onlyform
property for accessing the actual associated form element.The API mismatch between Web Awesome's custom form controls and the native ones makes it more difficult to write generic code that can handle both (
getForm
for WA controls,form
for native controls).To fix the mismatch, I propose renaming the
form
property to something likeassociatedForm
and make theform
property a read-only getter for getting the form element (whatgetForm
currently does).Beta Was this translation helpful? Give feedback.
All reactions