Leptos on:click event handlers not working - using onclick workaround
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
Leptos reactive event handlers (`on:click`) are not firing in the current setup. Regular JavaScript `onclick` attributes work fine.
## Symptoms
- Buttons with `on:click` handlers appear clickable (cursor changes) but don't trigger
- No console errors
- Reactive signals don't update their displayed values
- Standard JavaScript `onclick` handlers work correctly
## Current Workaround
Using JavaScript `onclick` attributes with inline JavaScript code instead of Leptos event handlers.
## Root Cause (Likely)
- Hydration mismatch between server-rendered HTML and client-side WASM
- Event delegation not properly initialized
- WASM module initialization timing issues
## Impact
- Cannot use Leptos reactive system properly
- Have to mix JavaScript and Rust code
- Lose type safety benefits of Rust event handlers
## Next Steps
- Debug WASM initialization process
- Check Leptos hydration settings
- Consider upgrading Leptos version or changing build configuration
- Investigate trunk serve vs trunk build differences
Related issues: #29, #30, #31
Contributor guide
Assessment
This issue has not been assessed yet.