fix(demotools): update DeesDemoWrapper to handle multiple slotted elements in runAfterRender callback

This commit is contained in:
Juergen Kunz
2025-06-16 14:35:28 +00:00
parent bed41da573
commit 87bbf0bbdc
5 changed files with 57 additions and 34 deletions

View File

@ -34,11 +34,11 @@ The properties panel has timing issues detecting rendered elements because:
## Created DeesDemoWrapper Component
- Location: ts_demotools/demotools.ts
- Allows wrapping demo elements with post-render functionality
- Provides runAfterRender callback that receives the rendered element
- Provides runAfterRender callback that receives ALL slotted elements as HTMLCollection
- Uses display: contents to not affect layout
- Handles timing automatically with 50ms delay after firstUpdated
- Supports both sync and async callbacks
- Exports available at @design.estate/dees-wcctools/demoTools
- Exports available at @design.estate/dees-wcctools/demotools (lowercase)
# Documentation Update (COMPLETED)
@ -50,4 +50,13 @@ The properties panel has timing issues detecting rendered elements because:
- Best practices and guidelines
- API reference
- Browser support information
- Complete examples for all major features
- Complete examples for all major features
# Enhanced DemoWrapper (COMPLETED)
## Modified runAfterRender callback:
- Now receives HTMLCollection of ALL slotted elements instead of just the first one
- Allows access to complete slotted DOM structure
- Updated documentation with correct import path (lowercase 'demotools')
- Examples show how to work with multiple slotted elements
- Maintains backward compatibility by accessing elements via index