diff --git a/src/validate/html/validateElement.ts b/src/validate/html/validateElement.ts
index 1156ebcea7..17ca5fc453 100644
--- a/src/validate/html/validateElement.ts
+++ b/src/validate/html/validateElement.ts
@@ -111,12 +111,15 @@ export default function validateElement(
);
}
- if (checkTypeAttribute(validator, node) !== 'checkbox') {
+ const type = checkTypeAttribute(validator, node);
+
+ if (type !== 'checkbox' && type !== 'radio') {
validator.error(
- `'${name}' binding can only be used with `,
+ `'checked' binding can only be used with or `,
attribute.start
);
}
+
} else if (name === 'group') {
if (node.name !== 'input') {
validator.error(
@@ -129,7 +132,7 @@ export default function validateElement(
if (type !== 'checkbox' && type !== 'radio') {
validator.error(
- `'checked' binding can only be used with or `,
+ `'group' binding can only be used with or `,
attribute.start
);
}
diff --git a/test/validator/samples/binding-input-checked/errors.json b/test/validator/samples/binding-input-checked/errors.json
index 05747dc96c..cbff8fe8ad 100644
--- a/test/validator/samples/binding-input-checked/errors.json
+++ b/test/validator/samples/binding-input-checked/errors.json
@@ -1,8 +1,8 @@
[{
- "message": "'checked' binding can only be used with ",
+ "message": "'checked' binding can only be used with or ",
"loc": {
"line": 1,
"column": 7
},
"pos": 7
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/binding-input-radio-group/errors.json b/test/validator/samples/binding-input-radio-group/errors.json
new file mode 100644
index 0000000000..b61e5796d8
--- /dev/null
+++ b/test/validator/samples/binding-input-radio-group/errors.json
@@ -0,0 +1,8 @@
+[{
+ "message": "'group' binding can only be used with or ",
+ "loc": {
+ "line": 1,
+ "column": 7
+ },
+ "pos": 7
+}]
diff --git a/test/validator/samples/binding-input-radio-group/input.html b/test/validator/samples/binding-input-radio-group/input.html
new file mode 100644
index 0000000000..3821c165b3
--- /dev/null
+++ b/test/validator/samples/binding-input-radio-group/input.html
@@ -0,0 +1 @@
+