Skip to content

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

mobile: scroll to top on tapping empty area in header

ammarahm-ed470e54a31f20
diff --git a/packages/editor-mobile/src/components/editor.tsx b/packages/editor-mobile/src/components/editor.tsx
index 317b71c95..7325c4ee9 100644
--- a/packages/editor-mobile/src/components/editor.tsx
+++ b/packages/editor-mobile/src/components/editor.tsx
@@ -109,6 +109,17 @@ const Tiptap = ({
const onClickEmptyArea: React.MouseEventHandler<HTMLDivElement> = useCallback(
(event) => {
+ if (
+ containerRef.current?.scrollTop &&
+ containerRef.current?.scrollTop > 0
+ ) {
+ containerRef.current?.scrollTo({
+ left: 0,
+ top: 0,
+ behavior: "smooth"
+ });
+ return;
+ }
const y = event.nativeEvent.pageY;
const x = event.nativeEvent.pageX;
const element = document.elementFromPoint(x, y);