-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: update error message to clarify usage with radio inputs #16874
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
Changes from 1 commit
9e5fe33
23ecd3d
d2e2021
926f9a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: update `bind:checked` error message to clarify usage with radio inputs |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -67,7 +67,11 @@ export function BindDirective(node, context) { | |||||
} | ||||||
} else { | ||||||
if (node.name === 'checked' && type?.value[0].data !== 'checkbox') { | ||||||
e.bind_invalid_target(node, node.name, '<input type="checkbox">'); | ||||||
e.bind_invalid_target( | ||||||
node, | ||||||
node.name, | ||||||
`<input type="checkbox"> - for <input type="radio">, use 'group' binding` | ||||||
|
`<input type="checkbox"> - for <input type="radio">, use 'group' binding` | |
`<input type="checkbox">${type.value[0].data === 'radio' ? ` — for <input type="radio">, use 'group' binding` : ''}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified.
I have a same experience of using bind:checked
with radio input.
At that time, I went to the official doc and realized we should use group
bind.
From that my experience, keeping extra message is friendly for developers but it is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified.