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

feat: Automatic attribute updates for form-associated proxy #4169

Closed
wants to merge 2 commits into from

Conversation

robarbms
Copy link
Contributor

@robarbms robarbms commented Dec 7, 2020

Description

Motivation & context

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@ghost
Copy link

ghost commented Dec 7, 2020

CLA assistant check
All CLA requirements met.

@robarbms robarbms changed the title Users/robarb/form associated proxy feat: Automatic attribute updates for form-associated proxy Dec 7, 2020
@robarbms robarbms linked an issue Dec 7, 2020 that may be closed by this pull request
@robarbms robarbms requested a review from nicholasrice December 7, 2020 17:26
@robarbms
Copy link
Contributor Author

robarbms commented Dec 7, 2020

Changes are up and running on my server.

Testing was a little tricky. If you click on something in the frame, it will draw focus, but I found it easiest to break the frame out using the 'Open canvas in new tab' button in the upper right corner. - http://robdor:6006/iframe.html?id=checkbox--base

Then you can run this script in the developer console:
["checkbox","slider","radio","switch","text-area","button","text-field","option"].reduce((t,c)=>t.concat(Array.from(document.getElementsByTagName(fast-${c}))),[]).forEach(e=>{console.log(["placeholder","formEnctype","formAction","formMethod","formNoValidate","formTarget","required","disabled","type","name","readOnly","min","max","step","autofocus","list"].reduce((o,a)=>{if(e.proxy[a]!==undefined&&e.proxy[a]!==null&&e.proxy[a]!==""){o[a]=e.proxy[a]}return o},{}));e.onchange=(i)=>setTimeout(()=>console.log(["checked","value","selected"].reduce((o,c)=>{o[c]=i.target.proxy[c];return o},{})),10)})

@robarbms robarbms closed this Feb 9, 2021
@robarbms
Copy link
Contributor Author

robarbms commented Feb 9, 2021

I will work on updating attributes through behaviors.

@robarbms robarbms deleted the users/robarb/form-associated-proxy branch February 9, 2021 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add FormAssociation mechanism to automatically map proxy values
1 participant