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

fix: add form submission and reset behavior to Button #3603

Merged
merged 6 commits into from
Jul 30, 2020

Conversation

nicholasrice
Copy link
Contributor

@nicholasrice nicholasrice commented Jul 30, 2020

Description

#3534 describes an issue where a FASTButton[type=submit] does not actually submit the parent form. In fixing this, I also noticed that a FASTButton[type=reset] does not reset the form. This introduces a fix to both behaviors.

A FASTButton[type=reset] will simply invoke the reset() method of the associated form element when clicked.

Submission behavior is a bit more complicated. The FASTButton[type=submit] will try to use the requestSubmit() method of the form if it exists, supplying the method with the button's proxy element as the submitting element (see #3534) for more info. If the requestSubmit() method is unavailable (Safari) then the proxy's click() method will be invoked.

closes #3534

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.

@nicholasrice nicholasrice force-pushed the users/nirice/submit-button-submission-fix branch from 3afa604 to bef33d3 Compare July 30, 2020 22:50
@nicholasrice nicholasrice merged commit f646343 into master Jul 30, 2020
@nicholasrice nicholasrice deleted the users/nirice/submit-button-submission-fix branch July 30, 2020 23:33
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.

type="submit" in fast-button won't work
3 participants