Skip to content

Commit

Permalink
fix(editor): ♿️ Improve code editor readiness
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 16, 2022
1 parent d2ac13b commit daaa8a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/builder/assets/styles/codeMirror.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.cm-editor {
height: 100%;
outline: 0px solid transparent !important;
height: 100%;
}

.cm-scroller {
Expand Down
11 changes: 9 additions & 2 deletions apps/builder/components/shared/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const CodeEditor = ({
if (!editorContainer.current) return
const updateListenerExtension = EditorView.updateListener.of((update) => {
if (update.docChanged && onChange)
setPlainTextValue(update.state.doc.toJSON().join(' '))
setPlainTextValue(update.state.doc.toJSON().join('\n'))
})
const extensions = [
updateListenerExtension,
Expand All @@ -77,5 +77,12 @@ export const CodeEditor = ({
return editor
}

return <Box ref={editorContainer} data-testid="code-editor" {...props} />
return (
<Box
ref={editorContainer}
data-testid="code-editor"
h={isReadOnly ? 'auto' : '250px'}
{...props}
/>
)
}

4 comments on commit daaa8a0

@vercel
Copy link

@vercel vercel bot commented on daaa8a0 Feb 16, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on daaa8a0 Feb 16, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

docs – ./apps/docs

docs.typebot.io
docs-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on daaa8a0 Feb 16, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on daaa8a0 Feb 16, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

viewer-v2-git-main-typebot-io.vercel.app
viewer-v2-typebot-io.vercel.app
typebot-viewer.vercel.app

Please sign in to comment.