Skip to content
Snippets Groups Projects

Issue #3466303: Component previews in left menu don't have style encapsulation

Merged Issue #3466303: Component previews in left menu don't have style encapsulation
2 unresolved threads
2 unresolved threads

Closes #3466303

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
282 283 styles.ComponentPreviewContent,
283 284 )}
284 285 >
285 {previewContent && (
286 <div
287 dangerouslySetInnerHTML={{ __html: previewContent }}
288 />
289 )}
286 <ShadowWrapper>
287 {previewContent && (
  • 12 const containerRef = useRef<HTMLDivElement | null>(null);
    13 const contentRef = useRef<HTMLDivElement | null>(null);
    14
    15 useEffect(() => {
    16 if (containerRef.current && !shadowRootRef.current) {
    17 shadowRootRef.current = containerRef.current.attachShadow({
    18 mode: 'open',
    19 });
    20
    21 const wrapper = document.createElement('div');
    22 shadowRootRef.current.appendChild(wrapper);
    23 contentRef.current = wrapper;
    24 }
    25
    26 if (contentRef.current) {
    27 ReactDOM.render(<>{children}</>, contentRef.current);
  • image.png

    Is there an opportunity here to reduce the number of nested divs around the tooltip content?

  • Jesse Baker requested changes

    requested changes

  • utkarsh_33 added 1 commit

    added 1 commit

    • 8fde2f2e - Removed unwanted extra divs and addressed feedbacks

    Compare with previous version

  • Jesse Baker approved this merge request

    approved this merge request

  • Jesse Baker added 7 commits

    added 7 commits

    • 8fde2f2e...1fbdc356 - 2 commits from branch project:0.x
    • 6616c518 - Issue #3466303: Component previews in left menu don't have style encapsulation
    • c15481ae - Added class to shadowDom Wrapper
    • 2f454eb6 - Attempt to make tests pass
    • 14bbc2c0 - Fixed tests and removed unwanted changes
    • 424670e1 - Removed unwanted extra divs and addressed feedbacks

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading