-
Notifications
You must be signed in to change notification settings - Fork 39
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
HTMLFormElement.attributes: Allow to extend HTML attributes programmatically. #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🤩
Is there a page on MDN where we can track the list of attributes? Though I guess it does not change that often anyway 🤞🏾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@gforcada something like this? https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes |
b535a0b
to
344f1ba
Compare
@icemac tnx for the review! I implemented your suggestions. |
Co-authored-by: Michael Howitz <icemac@gmx.net>
344f1ba
to
a8edac6
Compare
Came out of necessity and the discussion at: plone/plone.app.z3cform#176
See the z3c.form.browser.widgets.rst doctest on how to use it.
Basically it allows for attribute expansion in Chameleon templates like:
You can just set individual attributes like so:
There is no need to include the outdated and incomplete list of HTML attributes in the templates anymore. You can just set them via Python.
Note: This attribute expansion does only work that way in Chameleon. Therefore we cannot change any of the templates in z3c.form because - I think - it needs to stay compatible with the Zope PageTemplates reference implementation.