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
For instance, amp-list allows developers to specify the id of a template rather than including it as a descendant of the amp-list element. Under the current strategy, if a developer puts a template as a child of the body tag, bind will observe the body tag for mutations to its children.
We should change bind to not depend on a template's position to determine which elements to observe for mutations. That means depending on the element using the template (form, amp-list etc.) rather than the template to determine what to observe. Some potential solutions for forms are:
1: Keep the same strategy we have now if a template is a descendant of a form tag. Since forms must have templates as descendants of their <div success> and <div error> elements (if they exist), the current strategy would work as-is.
2: Specifically look for the success and error divs and observe them for mutations to their children.
If templates can be declared anywhere, we shouldn't rely on their location (perhaps forms will support template-by-id at some point). So (2) is the right strategy, though as mentioned previously it's best if delegated to the dynamic component itself.
Could we accomplish that with an override-able method on base element? For instance, a method that returns an array of elements that should be observed for changes in their descendants.
For instance, amp-list allows developers to specify the id of a template rather than including it as a descendant of the amp-list element. Under the current strategy, if a developer puts a template as a child of the body tag, bind will observe the body tag for mutations to its children.
We should change bind to not depend on a template's position to determine which elements to observe for mutations. That means depending on the element using the template (form, amp-list etc.) rather than the template to determine what to observe. Some potential solutions for forms are:
1: Keep the same strategy we have now if a template is a descendant of a form tag. Since forms must have templates as descendants of their
<div success>
and<div error>
elements (if they exist), the current strategy would work as-is.2: Specifically look for the success and error divs and observe them for mutations to their children.
@choumx what are your thoughts on this?
The text was updated successfully, but these errors were encountered: