Skip to content

Commit d02e5ca

Browse files
authored
fix: Prevent text from hiding behind navbar in Android (#2914)
1 parent 2459e06 commit d02e5ca

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

packages/web/src/javascripts/Components/NoteView/EditorContentWithSafeAreaPadding.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'
66

77
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
88
{
9-
isNoteLocked,
109
editorLineWidth,
1110
children,
1211
}: {
13-
isNoteLocked: boolean
1412
editorLineWidth: EditorLineWidth
1513
children: NonNullable<ReactNode>
1614
},
@@ -24,7 +22,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
2422
className={classNames(
2523
ElementIds.EditorContent,
2624
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
27-
hasBottomInset && isNoteLocked && 'pb-safe-bottom',
25+
hasBottomInset && 'pb-safe-bottom',
2826
)}
2927
style={
3028
{

packages/web/src/javascripts/Components/NoteView/NoteView.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,11 +955,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
955955
</div>
956956
)}
957957

958-
<EditorContentWithSafeAreaPadding
959-
isNoteLocked={this.state.noteLocked}
960-
editorLineWidth={this.state.editorLineWidth}
961-
ref={this.editorContentRef}
962-
>
958+
<EditorContentWithSafeAreaPadding editorLineWidth={this.state.editorLineWidth} ref={this.editorContentRef}>
963959
{editorMode === 'component' && this.state.editorComponentViewer && (
964960
<div className="component-view relative flex-grow">
965961
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}

packages/web/src/javascripts/Hooks/useSafeAreaPadding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export const useAvailableSafeAreaPadding = () => {
1414
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false)
1515
useEffect(() => {
1616
return application.addNativeMobileEventListener((event) => {
17-
if (event === ReactNativeToWebEvent.KeyboardDidShow) {
17+
if (event === ReactNativeToWebEvent.KeyboardWillShow) {
1818
setIsKeyboardVisible(true)
19-
} else if (event === ReactNativeToWebEvent.KeyboardDidHide) {
19+
} else if (event === ReactNativeToWebEvent.KeyboardWillHide) {
2020
setIsKeyboardVisible(false)
2121
}
2222
})

0 commit comments

Comments
 (0)