File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 197197 if (typeof this .inputValue === ' boolean' ) {
198198 return this .inputValue ;
199199 }
200- return Boolean ( this .inputValue !== null ) ;
200+ return this .inputValue !== null ;
201201 },
202202 set (checked ) {
203203 if (Array .isArray (this .inputValue )) {
255255 methods: {
256256 toggleCheck (event ) {
257257 if (! this .disabled ) {
258+ // Store the event that triggered this state change (mouse or keyboard)
259+ // so it can be forwarded with the emitted `change` event.
258260 this .lastUserEvent = event || null ;
259261 this .$refs .kCheckboxInput .focus ();
260262 this .isChecked = ! this .isChecked ;
261- this .lastUserEvent = null ;
262263 }
263264 },
264265 updateInputValue (newValue ) {
265266 /**
266267 * Emits change event with the new checkbox state.
267268 * Used by v-model or legacy API to keep the checkbox state in sync.
269+ * The original user event that triggered the change (if any)
270+ * is forwarded as a second argument for legacy API compatibility.
268271 */
269272 this .$emit (' change' , newValue, this .lastUserEvent );
273+ this .lastUserEvent = null ; // Reset after emitting the change event
270274 },
271275 markInactive () {
272276 this .isActive = false ;
You can’t perform that action at this time.
0 commit comments