Skip to content
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

Disabled support #164

Open
antun opened this issue Jun 28, 2023 · 2 comments
Open

Disabled support #164

antun opened this issue Jun 28, 2023 · 2 comments

Comments

@antun
Copy link

antun commented Jun 28, 2023

This is a feature request for a disabled flag on <LiveProvider> like react-live has (doc).

The goal is to allow someone to make the editor read-only:

const isEnabled = someLogicThatChecksIfEditorShouldBeEditable;

return (
 <LiveProvider code={code} scope={scope} disabled={isEnabled}>
    <LivePreview style={{ padding: '10px' }} />
    <LiveEditor style={{ minHeight: '100%', fontFamily: 'monospace' }}
    <LiveError />
  </LiveProvider>
);
@nihgwu
Copy link
Owner

nihgwu commented Jul 1, 2023

Add disabled to LiveError

@antun
Copy link
Author

antun commented Jul 17, 2023

@nihgwu do you mean:

<LiveError disabled={true} />

If so, I just tried that, but I can still edit the LiveEditor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants