Skip to content

Docs - LiveCode in table cell - block interaction #3610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changing for wrapper with pointerEvents
  • Loading branch information
Inbal-Tish committed Mar 13, 2025
commit 516a8d8a201a4835e0633f5734bf79dec95ea60d
11 changes: 5 additions & 6 deletions docuilib/src/components/pageComponents/ContentItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,20 @@ const ComponentItem = (props: ComponentItemProps) => {
}, []);

const componentPreview = (
<LiveProvider code={code} scope={ReactLiveScope}>
<LivePreview/>
</LiveProvider>
<div style={{pointerEvents: 'none'}}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add this as a class in the styles file. Wdyt?

<LiveProvider code={code} scope={ReactLiveScope}>
<LivePreview/>
</LiveProvider>
</div>
);

const codePreview = <CodeBlock snippet={code} title="Code Example"/>;

const content = showCode ? codePreview : componentPreview;

const interactionBlocker = <div style={{position: 'absolute', top: 0, left: 0, height: '100%', width: '100%'}}/>;

return (
<div className={`${styles.componentItemContainer} ${!showCode ? styles.componentSpotlightStyle : ''}`}>
{content}
{interactionBlocker}
{showCodeButton && (
<button onClick={toggleCode} className={styles.showCodeButton}>
<CodeIcon/>
Expand Down