Skip to content
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

Add FormAssociation mechanism to automatically map proxy values #3582

Closed
nicholasrice opened this issue Jul 28, 2020 · 2 comments
Closed

Add FormAssociation mechanism to automatically map proxy values #3582

nicholasrice opened this issue Jul 28, 2020 · 2 comments
Assignees
Labels
area:fast-foundation Pertains to fast-foundation closed:obsolete No longer valid feature A new feature warning:stale No recent activity within a reasonable amount of time

Comments

@nicholasrice
Copy link
Contributor

The FormAssociated base class leverages a proxy element to support browsers that do not support native form-association. Currently most components add a change handler and manually update the proxy element when parallel properties on the custom element change. This logic is largely duplicated.

We should provide a simple way to declare that a property should be reflected to the proxy element so that logic can be encapsulated. In general the mapping is 1-1 but there is 1 case where the value is mapped via the setAttribute API so there will need to be some level of configuration required.

This could look something like:

// before:
@attr
public name: string = ""
private nameChanged() {
  if (this.proxy instanceof HTMLElement) {
    this.proxy.name = this.name
  }
}

// After
@attr
@formAssociatedMapToProxy
public name: string = ""
@nicholasrice nicholasrice added feature A new feature status:triage New Issue - needs triage area:fast-foundation Pertains to fast-foundation labels Jul 28, 2020
@EisenbergEffect EisenbergEffect removed the status:triage New Issue - needs triage label Jul 29, 2020
@robarbms robarbms self-assigned this Aug 28, 2020
@robarbms robarbms linked a pull request Dec 7, 2020 that will close this issue
12 tasks
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the warning:stale No recent activity within a reasonable amount of time label Apr 16, 2022
@janechu
Copy link
Collaborator

janechu commented May 28, 2024

Per #6955 this issue is now obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-foundation Pertains to fast-foundation closed:obsolete No longer valid feature A new feature warning:stale No recent activity within a reasonable amount of time
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants