handle-modus-checkbox-value-bug

Invert raw ModusWcCheckbox values before updating React form state.

3|2|Updated Oct 3, 2025
One-click install
npx skills add https://github.com/julianoczkowski/create-trimble-app --skill handle-modus-checkbox-value-bug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: handle-modus-checkbox-value-bug
Source: https://github.com/julianoczkowski/create-trimble-app/tree/main/templates/react/.cursor/skills/handle-modus-checkbox-value-bug
Command: npx skills add https://github.com/julianoczkowski/create-trimble-app --skill handle-modus-checkbox-value-bug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The ModusWcCheckbox value inversion bug causes target.value to reflect the opposite of the actual checked state, leading to incorrect form state.

Core Features & Use Cases

  • Invert the raw value from ModusWcCheckbox events before updating UI state.
  • Provide a robust pattern for React components using Modus2.0 ModusCheckbox wrappers to ensure consistent behavior.
  • Document the workaround and guard against double inversion in wrappers or consumer code.

Quick Start

Integrate the inversion workaround in your checkbox event handling and verify correct state updates in your form.

Frequently Asked Questions about handle-modus-checkbox-value-bug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Modus checkbox value show the opposite of its checked state in React?

The ModusWcCheckbox value inversion bug causes target.value to reflect the opposite of the actual checked state. Inverting the raw event value before updating React state corrects this inconsistency in form data-binding.

How do I fix the ModusWcCheckbox value inversion bug in React forms?

Fix the ModusWcCheckbox value inversion by inverting the raw event value before assigning it to your React state. This workaround ensures correct checkbox state updates and consistent form behavior.

Does this checkbox value workaround prevent double inversion in Modus wrappers?

Yes, the pattern documents the inversion workaround and guards against double inversion in consumer code or Modus 2.0 component wrappers, ensuring the checkbox state is only corrected once.

What causes incorrect form state when using Modus 2.0 checkboxes?

Incorrect form state is caused by the ModusWcCheckbox value inversion bug, where the event target value does not match the actual checked state, leading to inaccurate data binding in React components.