Skip to content

Commit 69a446f

Browse files
committed
chore: add single-line-editor for rte
1 parent 047025b commit 69a446f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

packages/frontend/src/components/RichTextEditor/RichTextEditor.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,31 @@
284284
}
285285
}
286286
}
287+
288+
.single-line-editor {
289+
white-space: nowrap;
290+
overflow-x: auto;
291+
overflow-y: hidden;
292+
max-width: 100%;
293+
display: flex;
294+
align-items: center;
295+
// NOTE: below is to make sure the scrollbar adopts the editor's border radius
296+
border-radius: inherit;
297+
mask-image: linear-gradient(to right, black 100%, black 100%);
298+
-webkit-mask-image: linear-gradient(to right, black 100%, black 100%);
299+
300+
// NOTE: forcefully hide the scrollbar so that it does not
301+
// cause misalignment with the height of the multirow
302+
&::-webkit-scrollbar {
303+
display: none;
304+
}
305+
306+
.editor__content {
307+
min-width: min-content;
308+
}
309+
310+
.ProseMirror {
311+
width: 100%;
312+
white-space: nowrap;
313+
}
314+
}

packages/frontend/src/components/RichTextEditor/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const Editor = ({
255255
}}
256256
>
257257
<PopoverTrigger>
258-
<Box>
258+
<Box className={isMulticol ? 'single-line-editor' : undefined}>
259259
{isRich && <MenuBar editor={editor} variableMap={varInfo} />}
260260
<EditorContent className="editor__content" editor={editor} />
261261
<Portal>

0 commit comments

Comments
 (0)