-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[NEXT-1197] (AppDir) <input type="radio" defaultChecked />
is unchecked immediately.
#48778
Comments
<input type="radio" defaultChecked />
is unchecked immediately.<input type="radio" defaultChecked />
is unchecked immediately.
Just ran into this so wanted to update — still experiencing this in 13.4.1 (stable) and it happens with To anyone running across this issue, here's how I solved it pending an actual fix: <input
type="radio"
name="a"
defaultChecked={shouldBeChecked}
ref={input => {
if (input && shouldBeChecked) input.checked = true;
}}
/> |
<input type="radio" defaultChecked />
is unchecked immediately.<input type="radio" defaultChecked />
is unchecked immediately.
This comment has been minimized.
This comment has been minimized.
Should be fixed in v13.5.6-canary.1 via 0a80017 |
Why do I always run into the weirdest bugs. Also seeing this behavior |
Still exists in version 13.5.6 under dev mode. |
Going to close this as no new reproduction was provided. If you're running into something like this please open a new issue with a reproduction. Thanks! |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-cnys4q (app directory, the issue happens)
https://stackblitz.com/edit/vercel-next-js-m8f8gg (pages directory, the issue doesn't happen)
To Reproduce
bandicam.2023-04-24.22-56-18-749.mp4
Describe the Bug
There are 4
<input type="radio">
s<input type="radio" name="a" defaultChecked={true} />
<input type="radio" name="a" defaultChecked={false} />
<input type="radio" name="b" defaultChecked={true} />
<input type="radio" defaultChecked={true} />
On page refresh, the first, third and fourth one have been checked initially, but the first one is unchecked right after.
This issue seems that was introduced since
next@13.3.1-canary.17
.Expected Behavior
Default checked radio input that has same name should remains checked.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1197
The text was updated successfully, but these errors were encountered: