julianoczkowski/create-trimble-app/fix-modus-component-event-issues
Claude Code and agent skill by julianoczkowski/create-trimble-app
- community
Checking that the SKILL.md file is still in the repository.
Debug and fix common event handling problems with Modus web components
Install
npx vskill@latest install julianoczkowski/create-trimble-app/fix-modus-component-event-issuesSKILL.md
Fix Modus Component Event Issues
Debug and fix common event handling problems with Modus web components in SolidJS.
When to Use
Use this skill when:
- Events aren't firing on Modus components
- Components aren't responding to user interactions
- Event handlers aren't being called
- You suspect event listener setup issues
Common Issues and Solutions
Issue 1: Events Not Firing
Symptoms: Click handlers, change handlers, or other events don't fire.
Causes:
- Missing event listener setup
- Wrong event name
- Component ref not set up
- Handler not passed as prop
Solution:
Checklist:
- [ ] Component ref is created:
let componentEl: HTMLModusWcComponentElement | undefined - [ ] Callback ref is used:
<modus-wc-component ref={(el) => (componentEl = el)} /> - [ ] Event listener is added in
createEffect - [ ] Event name matches Modus documentation
- [ ] Cleanup function removes listener
Issue 2: Missing Cleanup
Symptoms: Memory leaks, events firing multiple times, component errors after unmount.
Solution:
Issue 3: Wrong Event Names
Symptoms: Events never fire, wrong event type received.
Common Event Names:
| Component | Event Name | Detail Type | ||
|---|---|---|---|---|
| Checkbox | inputChange | InputEvent | ||
| TextInput | inputChange | InputEvent | ||
| DropdownMenu | itemSelect | { value: string } | ||
| DropdownMenu | menuVisibilityChange | { isVisible: boolean } | ||
| Navbar | searchClick | `MouseEvent \ | KeyboardEvent` | |
| Accordion | expandedChange | { expanded: boolean; index: number } |
Solution: Check Modus documentation for exact event names. They're case-sensitive.
Issue 4: Missing Ref
Symptoms: Cannot read property 'addEventListener' of null, events don't attach.
Solution:
Issue 5: Wrong Event Target
Symptoms: Can't access component properties, wrong value extracted.
Solution:
Issue 6: Multiple Event Listeners
Symptoms: Events fire multiple times, duplicate handlers.
Solution:
Debugging Checklist
When events aren't working, check:
- Ref Setup
- [ ]
let refis declared with correct type - [ ] Callback ref is passed to web component
- [ ] Ref is checked before use (
if (!component) return)
- Event Listener Setup
- [ ] Listener is added in
createEffect - [ ] Event name matches Modus documentation
- [ ] Handler function is defined
- [ ] Handler is conditionally attached (if prop exists)
- Cleanup
- [ ] Cleanup function is returned from
createEffect - [ ] Listener is removed in cleanup
- [ ] Same handler reference is used for add/remove
- Event Handling
- [ ] Event is cast to correct
CustomEventtype - [ ] Value is extracted correctly (
target.valuevsdetail) - [ ] Handler is called with correct parameters
Quick Fixes
Fix: Events Not Firing
- Check if ref is set:
console.log(componentEl) - Verify event name: Check Modus docs
- Add console.log in handler to verify it's called
- Check if handler prop is passed
Fix: Events Firing Multiple Times
- Check if cleanup is removing listeners
- Verify handler isn't recreated on each render
- Ensure createEffect dependencies are correct
Fix: Wrong Values
- Verify event type casting
- Check if using
target.valuevsdetail - For checkboxes, verify value inversion is handled
Related Files
src/components/ModusCheckbox.tsx- Event handling examplesrc/components/ModusDropdownMenu.tsx- Multiple events examplesrc/components/ModusNavbar.tsx- Complex event handling
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtemplates/solidjs/.cursor/skills/fix-modus-component-event-issues/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/julianoczkowski/create-trimble-app/fix-modus-component-event-issues)