-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Component: amp-formCustomer: EmailINTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeType: DevXissues impacting developer experienceissues impacting developer experienceWG: components
Description
Summary
This proposes a new amp-form-dirty class, that will be applied to AMP form’s <form> element, when any of its containing form controls is dirty.
This allows AMP document developers to style forms differently when it has been modified by the user, and there are unsubmitted data.
Design Document
https://docs.google.com/document/d/16Q3yY-XRtCVjlcsRYkrXYlmZJfcIrFgnMKqXsy3nS4w
Attack Plan
- Export
isDisabledhelper - Extract an
isFieldDefaulthelper from currentisDirty_implementation - An
isFieldEmptyhelper that checks if a field is empty - Track text-type
inputs andtextarea's dirtiness, based on default value and emptiness - Track radio button, checkbox, and dropdown menu's dirtiness, based on default value and emptiness
- Track submitted form data
- Track
amp-bindform values changes
Potential Future Improvements
- Support custom AMP components (e.g.
<amp-selector>) - Track some attribute changes (
disabledandhidden) with a Mutation Observer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: amp-formCustomer: EmailINTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeType: DevXissues impacting developer experienceissues impacting developer experienceWG: components