Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'

export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
{
isNoteLocked,
editorLineWidth,
children,
}: {
isNoteLocked: boolean
editorLineWidth: EditorLineWidth
children: NonNullable<ReactNode>
},
Expand All @@ -24,7 +22,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
className={classNames(
ElementIds.EditorContent,
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
hasBottomInset && isNoteLocked && 'pb-safe-bottom',
hasBottomInset && 'pb-safe-bottom',
)}
style={
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
</div>
)}

<EditorContentWithSafeAreaPadding
isNoteLocked={this.state.noteLocked}
editorLineWidth={this.state.editorLineWidth}
ref={this.editorContentRef}
>
<EditorContentWithSafeAreaPadding editorLineWidth={this.state.editorLineWidth} ref={this.editorContentRef}>
{editorMode === 'component' && this.state.editorComponentViewer && (
<div className="component-view relative flex-grow">
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/javascripts/Hooks/useSafeAreaPadding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const useAvailableSafeAreaPadding = () => {
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false)
useEffect(() => {
return application.addNativeMobileEventListener((event) => {
if (event === ReactNativeToWebEvent.KeyboardDidShow) {
if (event === ReactNativeToWebEvent.KeyboardWillShow) {
setIsKeyboardVisible(true)
} else if (event === ReactNativeToWebEvent.KeyboardDidHide) {
} else if (event === ReactNativeToWebEvent.KeyboardWillHide) {
setIsKeyboardVisible(false)
}
})
Expand Down
Loading