Overview
The component preview that generates a preview in real time for components when they are hovered isn't working for JS components.
Steps to reproduce:
- Create a JS component
- Go back to editing a page
- Hover over the component
- Confirm that there's no component preview visible on hover
Proposed resolution
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot 2025-02-27 at 4.44.58 PM.png | 83.43 KB | wim leers |
| #6 | xb-code-comp.png | 76.81 KB | omkar-pd |
Issue fork experience_builder-3508975
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
omkar-pd commentedThe component preview is now loading, but it appears empty. Debugging the issue.
Comment #5
wim leersComment #6
omkar-pd commentedI think the work on default_markup for code components is still pending.
default_markup: "@todo Make something 🆒 in https://www.drupal.org/project/experience_builder/issues/3498889"- Which appears to be fixed issue.Comment #7
omkar-pd commentedComment #8
wim leersUpdating title for consistent terminology.
Tagging per https://www.drupal.org/project/experience_builder/issues/3455753#release....
Comment #9
wim leersComment #10
wim leers#6: Good observation, but that's not responsible for the preview 😅
/xb/api/config/componentdoes render preview markup for code components:Investigating…
Comment #12
wim leersPaired with @balintbrews — he gave me a hunch!
Note how the example in #10 does not include the import maps!
Comment #13
wim leersBingo:

What was needed, is making
#attached[import_maps]be respected not just when rendering a full HTML response, but also when rendering each individual component preview.Comment #15
wim leersPer @hooroomoo's review — they manually tested it; it didn’t interfere with any click events for opening the menus which was their concern 🥳
Comment #16
omkar-pd commented🙌🙌👏👏
Comment #17
wim leersComment #19
nagwani commented