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 radio button null element default prop to use correct input #10510

Merged
merged 4 commits into from May 8, 2024

Conversation

jason-curtis
Copy link
Contributor

Previously, radio buttons always had the first element that referred to props.spot.spotType:

          <RadioField
            id=...
            name=...
            defaultValue=...
            defaultChecked={!props.spot?.spotType}
            className="rw-input"
            errorClassName="rw-input rw-input-error"
          />

In actuality, instead of "spot" and "spotType" we should be using the actual name of the model and column!

@Tobbe
Copy link
Member

Tobbe commented Apr 24, 2024

Thanks for the PR @jason-curtis
Do you think you could add some tests for this? No pressure, someone on the core team can do it if you don't want to. But the PR will get merged much faster if you write the tests 🙂

@jason-curtis
Copy link
Contributor Author

jason-curtis commented Apr 24, 2024

Understood. Let's see if I get to the tests before a maintainer does!

@cannikin
Copy link
Member

Holy cow I can't believe this has been in here like this for so long without someone noticing! Thanks for this fix @jason-curtis!

@thedavidprice thedavidprice added the contributor-pr Use to automatically add PRs to the "Contributor PRs" Project Board label May 1, 2024
@Josh-Walker-GM
Copy link
Collaborator

Hey @jason-curtis, I'm aiming to try get this one in sometime this week. If you want to add tests to it then I can hold off but otherwise I'll get to it in the next couple days.

@Josh-Walker-GM Josh-Walker-GM added this to the next-release-patch milestone May 8, 2024
@Josh-Walker-GM Josh-Walker-GM added the release:fix This PR is a fix label May 8, 2024
@jason-curtis
Copy link
Contributor Author

jason-curtis commented May 8, 2024 via email

@Josh-Walker-GM Josh-Walker-GM enabled auto-merge (squash) May 8, 2024 15:33
@Josh-Walker-GM Josh-Walker-GM merged commit 8ee646b into redwoodjs:main May 8, 2024
45 of 46 checks passed
Josh-Walker-GM added a commit that referenced this pull request May 8, 2024
Previously, radio buttons always had the first element that referred to
`props.spot.spotType`:
```
          <RadioField
            id=...
            name=...
            defaultValue=...
            defaultChecked={!props.spot?.spotType}
            className="rw-input"
            errorClassName="rw-input rw-input-error"
          />
```

In actuality, instead of "spot" and "spotType" we should be using the
actual name of the model and column!

---------

Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor-pr Use to automatically add PRs to the "Contributor PRs" Project Board release:fix This PR is a fix
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants