Skip to content

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

fix: center editor in focus mode (fixes streetwriters/notesnook#177)

thecodrrdbab7629a2f0
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index 5540aed7d..9838ddc70 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -198,7 +198,10 @@ function Editor({ noteId, nonce }) {
</Flex>
) : null}
<Toolbar />
- <FlexScrollContainer className="editorScroll">
+ <FlexScrollContainer
+ className="editorScroll"
+ viewStyle={{ display: "flex", flexDirection: "column" }}
+ >
<Flex
id="editorToolbar"
sx={{
diff --git a/apps/web/src/components/scroll-container/index.js b/apps/web/src/components/scroll-container/index.js
index 0ee36156e..9ecc62ef0 100644
--- a/apps/web/src/components/scroll-container/index.js
+++ b/apps/web/src/components/scroll-container/index.js
@@ -28,7 +28,13 @@ const ScrollContainer = ({ children, style, forwardedRef, ...props }) => {
};
export default ScrollContainer;
-export function FlexScrollContainer({ children, className, style, ...props }) {
+export function FlexScrollContainer({
+ children,
+ className,
+ style,
+ viewStyle,
+ ...props
+}) {
return (
<Scrollbars
{...props}
@@ -50,6 +56,7 @@ export function FlexScrollContainer({ children, className, style, ...props }) {
overflow: "scroll",
position: "relative",
flex: "1 1 auto",
+ ...viewStyle,
}}
sx={{
scrollbarWidth: "none",