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

Specify form selector #527

Merged
merged 28 commits into from
Jul 19, 2021

Conversation

julianrubisch
Copy link
Contributor

Enhancement

Description

This PR adds the possibility to declare a custom form selector to be used when scooping up form parameters:

<div data-reflex="..." data-reflex-form-selector="#custom_form">....</div>
this.stimulate("MyReflex#action", this.element, { formSelector: "#custom_form" })

Note: This is based on my work on #517, the actual diff is much smaller: 4c39aff

Why should this be added

At the moment I'm building a WizardReflex where the actual form is separated from the navigation buttons/tabs, thus form params wouldn't be submitted.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

Please note that the best way to suggest changes or updates to the documentation is to join Discord and leave a note in the #docs channel. Any documentation updates posted as PRs cannot be accepted at this time. ❤️

@leastbad
Copy link
Contributor

Out of the gate: there are documentation changes in here. Please, please take them out.

@julianrubisch
Copy link
Contributor Author

easy, this is going to rebased once #517 lands

@leastbad
Copy link
Contributor

I can't stress enough how poorly GitBook handles non-clean merges. I get super jumpy when I see things creep in...

Copy link
Member

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

I like the general direction of this PR 👍🏼

javascript/stimulus_reflex.js Outdated Show resolved Hide resolved
@julianrubisch
Copy link
Contributor Author

julianrubisch commented Jun 29, 2021

I can't stress enough how poorly GitBook handles non-clean merges. I get super jumpy when I see things creep in...

Admittedly, it's hard to reason about it this way. Still I wanted to put it out there. We'll have to wait for @hopsoft to review #517

@leastbad
Copy link
Contributor

Essentially, every paragraph in the docs that has at least one changed character gets duplicated 2-3 times, showing a before/after... but it's all just text. You have to scan every page looking for dupes, and fussing to make sure the right version persists.

It takes hours.

@julianrubisch julianrubisch added javascript Pull requests that update Javascript code proposal labels Jun 29, 2021
@leastbad leastbad added this to the 3.5 milestone Jun 30, 2021
@julianrubisch julianrubisch force-pushed the specify-form-element branch from 0be1049 to 4c39aff Compare July 6, 2021 10:09
@julianrubisch julianrubisch force-pushed the specify-form-element branch from 4c39aff to 3c123d6 Compare July 7, 2021 06:37
Copy link
Contributor

@hopsoft hopsoft left a comment

Choose a reason for hiding this comment

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

Nice work. Let's wait for #517 to land then get this merged.

@julianrubisch julianrubisch force-pushed the specify-form-element branch from 258121b to 62eb8fa Compare July 19, 2021 07:04
@leastbad leastbad merged commit 4153b78 into stimulusreflex:master Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants