Files
Will Miao 822ac046e0 docs: update DOM widget value persistence best practices guide
- Restructure document to clearly separate simple vs complex widget patterns
- Add detailed explanation of ComfyUI's built-in callback mechanism
- Provide complete implementation examples for both patterns
- Remove outdated sync chain diagrams and replace with practical guidance
- Emphasize using DOM element as source of truth for simple widgets
- Document proper use of internal state with widget.callback for complex widgets
2026-01-27 22:51:09 +08:00
..

DOM Widgets Documentation

Documentation for custom DOM widget development in ComfyUI LoRA Manager.

Files

Key Lessons

Common Anti-Patterns

Don't: Create internal state variables
Don't: Use v-model for text inputs
Don't: Add serializeValue, onSetValue callbacks
Don't: Watch props.widget.value

Best Practices

Do: Use DOM element as single source of truth
Do: Store DOM reference on widget.inputEl
Do: Direct getValue/setValue to DOM
Do: Clean up reference on unmount