fix(demotools): enhance runAfterRender to provide full DOM API access and improve element selection

This commit is contained in:
Juergen Kunz
2025-06-16 14:45:19 +00:00
parent 578f87a8f9
commit d4fce8a939
4 changed files with 56 additions and 38 deletions

View File

@ -55,8 +55,10 @@ The properties panel has timing issues detecting rendered elements because:
# 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
- Now receives the wrapper element itself instead of just children
- Provides full DOM API access (querySelector, querySelectorAll, etc.)
- querySelector works on slotted content (light DOM children)
- Access children via wrapper.children property
- 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
- Examples show how to use querySelector for powerful element selection
- Added clarifying comment about querySelector working on slotted content