fix: Prevent text from hiding behind navbar in Android (#2914)
This commit is contained in:
committed by
GitHub
parent
2459e06b19
commit
d02e5cab74
@@ -6,11 +6,9 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'
|
|||||||
|
|
||||||
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
|
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
|
||||||
{
|
{
|
||||||
isNoteLocked,
|
|
||||||
editorLineWidth,
|
editorLineWidth,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
isNoteLocked: boolean
|
|
||||||
editorLineWidth: EditorLineWidth
|
editorLineWidth: EditorLineWidth
|
||||||
children: NonNullable<ReactNode>
|
children: NonNullable<ReactNode>
|
||||||
},
|
},
|
||||||
@@ -24,7 +22,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
|
|||||||
className={classNames(
|
className={classNames(
|
||||||
ElementIds.EditorContent,
|
ElementIds.EditorContent,
|
||||||
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
|
'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={
|
style={
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -955,11 +955,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<EditorContentWithSafeAreaPadding
|
<EditorContentWithSafeAreaPadding editorLineWidth={this.state.editorLineWidth} ref={this.editorContentRef}>
|
||||||
isNoteLocked={this.state.noteLocked}
|
|
||||||
editorLineWidth={this.state.editorLineWidth}
|
|
||||||
ref={this.editorContentRef}
|
|
||||||
>
|
|
||||||
{editorMode === 'component' && this.state.editorComponentViewer && (
|
{editorMode === 'component' && this.state.editorComponentViewer && (
|
||||||
<div className="component-view relative flex-grow">
|
<div className="component-view relative flex-grow">
|
||||||
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}
|
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export const useAvailableSafeAreaPadding = () => {
|
|||||||
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false)
|
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return application.addNativeMobileEventListener((event) => {
|
return application.addNativeMobileEventListener((event) => {
|
||||||
if (event === ReactNativeToWebEvent.KeyboardDidShow) {
|
if (event === ReactNativeToWebEvent.KeyboardWillShow) {
|
||||||
setIsKeyboardVisible(true)
|
setIsKeyboardVisible(true)
|
||||||
} else if (event === ReactNativeToWebEvent.KeyboardDidHide) {
|
} else if (event === ReactNativeToWebEvent.KeyboardWillHide) {
|
||||||
setIsKeyboardVisible(false)
|
setIsKeyboardVisible(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user