From bb2e30b287c5561492eb0aad6ac4258fc28b87f9 Mon Sep 17 00:00:00 2001 From: Radek Czemerys Date: Sat, 28 Nov 2020 21:45:19 +0100 Subject: [PATCH] fix: floating button position on iPad --- src/screens/Notes/Notes.tsx | 10 ++++++++-- src/screens/Root.tsx | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/screens/Notes/Notes.tsx b/src/screens/Notes/Notes.tsx index 6c8c14f2..ef652a7c 100644 --- a/src/screens/Notes/Notes.tsx +++ b/src/screens/Notes/Notes.tsx @@ -34,7 +34,13 @@ import { StyledIcon } from './Notes.styled'; import { notePassesFilter, NoteSortKey } from './utils'; export const Notes = React.memo( - ({ shouldSplitLayout }: { shouldSplitLayout: boolean | undefined }) => { + ({ + shouldSplitLayout, + keyboardHeight, + }: { + shouldSplitLayout: boolean | undefined; + keyboardHeight: number | undefined; + }) => { // Context const application = useContext(ApplicationContext); const theme = useContext(ThemeContext); @@ -477,7 +483,7 @@ export const Notes = React.memo( // @ts-ignore style prop does not exist in types style={ application?.getAppState().isInTabletMode - ? { bottom: application?.getAppState().getKeyboardHeight() } + ? { bottom: keyboardHeight } : undefined } buttonColor={theme.stylekitInfoColor} diff --git a/src/screens/Root.tsx b/src/screens/Root.tsx index 008e0f02..abc7f66a 100644 --- a/src/screens/Root.tsx +++ b/src/screens/Root.tsx @@ -136,7 +136,10 @@ export const Root = (): JSX.Element | null => { notesListCollapsed={noteListCollapsed} shouldSplitLayout={shouldSplitLayout} > - + {hasEditor && shouldSplitLayout && (