Skip to content

Commit 839d8bb

Browse files
authored
feat(QRadio/QCheckbox): Emit the event that produced the change as the second parameter of @input (quasarframework#7002)
- used to allow keyboard modifiers
1 parent fd8c97a commit 839d8bb

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

ui/src/components/radio/QRadio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default Vue.extend({
102102
}
103103

104104
if (this.disable !== true && this.isTrue !== true) {
105-
this.$emit('input', this.val)
105+
this.$emit('input', this.val, e)
106106
}
107107
}
108108
},

ui/src/components/radio/QRadio.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,22 @@
7474

7575
"events": {
7676
"input": {
77-
"extends": "input"
77+
"desc": "Emitted when the component needs to change the model; Is also used by v-model",
78+
"params": {
79+
"value": {
80+
"type": "Any",
81+
"desc": "New model value",
82+
"required": true,
83+
"__exemption": [ "examples" ]
84+
},
85+
"evt": {
86+
"type": "Object",
87+
"desc": "JS event object",
88+
"required": true,
89+
"__exemption": [ "examples" ],
90+
"addedIn":"v1.11.2"
91+
}
92+
}
7893
}
7994
},
8095

ui/src/mixins/checkbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default {
160160
val = this.falseValue
161161
}
162162

163-
this.$emit('input', val)
163+
this.$emit('input', val, e)
164164
},
165165

166166
__onKeydown (e) {

ui/src/mixins/checkbox.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,22 @@
9393

9494
"events": {
9595
"input": {
96-
"extends": "input"
96+
"desc": "Emitted when the component needs to change the model; Is also used by v-model",
97+
"params": {
98+
"value": {
99+
"type": "Any",
100+
"desc": "New model value",
101+
"required": true,
102+
"__exemption": [ "examples" ]
103+
},
104+
"evt": {
105+
"type": "Object",
106+
"desc": "JS event object",
107+
"required": true,
108+
"__exemption": [ "examples" ],
109+
"addedIn":"v1.11.2"
110+
}
111+
}
97112
}
98113
},
99114

0 commit comments

Comments
 (0)