Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor(components): miscellaneous form updates #100

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

joshuagraber
Copy link
Collaborator

@joshuagraber joshuagraber commented Aug 20, 2024

Miscellaneous updates to Form

Background

  • Sometimes it is useful to pass attributes to the form element via the component interface.
  • Sometimes it is useful to have the DOM event present on emitted events
  • Sometimes it is useful to manually update a form's values

Description

  • Passes attrs through from the component to the form element
  • Exposes the native DOM event on submit and change events (change is actually the input event on form input elements, but changing this would be breaking, so we'll wait)
  • Exposes a setValues method on Form, allowing calling components to update the full values state programatically. (Useful for instance in search-v2, where we may want to default to All record types being checked, but uncheck it any time another record type is checked, and vice versa.)

Acceptance Criteria

  1. Run the demo app, navigate to localhost:8888. Ensure that everything still works

Pass attrs through to form element, pass event with data on emits, update test snapshot
@joshuagraber joshuagraber self-assigned this Aug 20, 2024
@joshuagraber joshuagraber changed the title refactor(form): miscellaneous updates refactor(components): miscellaneous form updates Aug 20, 2024
@@ -7,7 +7,7 @@ exports[`QuickSearchForm component > Renders a QuickSearchForm 1`] = `
</p>
</div>
<div class="pdap-quick-search-form h-full max-h-[75-vh] justify-start p-0">
<form class="pdap-form flex flex-wrap gap-x-4" id="quick-search-form" name="quickSearchForm">
<form class="pdap-form flex flex-wrap gap-x-4 flex flex-wrap gap-x-4" id="quick-search-form" name="quickSearchForm">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't hurting anything, but maybe redundant? I would believe these are generated and applied to the form for some valid reason that would affect the snapshot, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josh-chamberlain No, that's important, actually, thank you for catching. It relates to v-bind merge behavior, and could cause problems in Form down the line. Making this update and one other.

Copy link
Contributor

@josh-chamberlain josh-chamberlain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a nitpick but this looks good

include coverage for setValues
@joshuagraber joshuagraber merged commit 08965c1 into beta Aug 20, 2024
5 checks passed
@joshuagraber joshuagraber deleted the refactor/miscellaneous-form-updates branch August 20, 2024 18:43
Copy link

🎉 This PR is included in version 3.0.0-beta.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 3.0.1-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Jan 2, 2025

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants