Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

Revert "web: fix editor toolbar scroll styling (#7113)"

Abdullah Atta90d23384127a
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index 7aad00088..5d0c4d2cc 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -376,7 +376,11 @@ function TipTap(props: TipTapProps) {
<Toolbar
editor={editor}
location={"top"}
- sx={isTablet || isMobile ? { flexWrap: "nowrap" } : {}}
+ sx={
+ isTablet || isMobile
+ ? { overflowX: "scroll", flexWrap: "nowrap" }
+ : {}
+ }
tools={toolbarConfig}
defaultFontFamily={fontFamily}
defaultFontSize={fontSize}
diff --git a/packages/editor/src/toolbar/toolbar.tsx b/packages/editor/src/toolbar/toolbar.tsx
index 43c522feb..8d90a71dc 100644
--- a/packages/editor/src/toolbar/toolbar.tsx
+++ b/packages/editor/src/toolbar/toolbar.tsx
@@ -34,7 +34,6 @@ import {
useToolbarStore
} from "./stores/toolbar-store.js";
import { ToolbarDefinition } from "./types.js";
-import { ScrollContainer } from "@notesnook/ui";
type ToolbarProps = FlexProps & {
editor: Editor;
@@ -90,44 +89,34 @@ export function Toolbar(props: ToolbarProps) {
return (
<>
- <ScrollContainer
- className="tabsScroll"
- suppressScrollY
- style={{ flex: 1 }}
- trackStyle={() => ({
- backgroundColor: "transparent",
- pointerEvents: "none"
- })}
- thumbStyle={() => ({ height: 3 })}
+ <Flex
+ className={["editor-toolbar", className].join(" ")}
+ sx={{
+ flexWrap: isMobile ? "nowrap" : "wrap",
+ overflowX: isMobile ? "auto" : "hidden",
+ bg: "background",
+ borderRadius: isMobile ? "0px" : "default",
+ ...sx
+ }}
+ {...flexProps}
>
- <Flex
- className={["editor-toolbar", className].join(" ")}
- sx={{
- flexWrap: isMobile ? "nowrap" : "wrap",
- bg: "background",
- borderRadius: isMobile ? "0px" : "default",
- ...sx
- }}
- {...flexProps}
- >
- {toolbarTools.map((tools) => {
- return (
- <ToolbarGroup
- key={tools.join("")}
- tools={tools}
- editor={editor}
- groupId={tools.join("")}
- sx={{
- borderRight: "1px solid var(--separator)",
- ":last-of-type": { borderRight: "none" },
- alignItems: "center"
- }}
- />
- );
- })}
- </Flex>
- <EditorFloatingMenus editor={editor} />
- </ScrollContainer>
+ {toolbarTools.map((tools) => {
+ return (
+ <ToolbarGroup
+ key={tools.join("")}
+ tools={tools}
+ editor={editor}
+ groupId={tools.join("")}
+ sx={{
+ borderRight: "1px solid var(--separator)",
+ ":last-of-type": { borderRight: "none" },
+ alignItems: "center"
+ }}
+ />
+ );
+ })}
+ </Flex>
+ <EditorFloatingMenus editor={editor} />
</>
);
}