fix: sticky header behavior on iOS (#1662)

This commit is contained in:
Aman Harwara
2022-09-28 18:36:42 +05:30
committed by GitHub
parent 6e10911d02
commit c0af596f2d

View File

@@ -13,6 +13,7 @@ import {
NoteViewController,
PayloadEmitSource,
WebAppEvent,
Platform,
} from '@standardnotes/snjs'
import { debounce, isDesktopApplication, isIOS } from '@/Utils'
import { EditorEventSource } from '../../Types/EditorEventSource'
@@ -928,7 +929,11 @@ class NoteView extends PureComponent<NoteViewProps, State> {
className={classNames(
'content-title-bar section-title-bar z-editor-title-bar w-full bg-default',
this.state.shouldStickyHeader && 'fixed top-0',
this.state.shouldStickyHeader ? (isIOS() ? 'pt-safe-top' : 'pt-4') : '',
this.state.shouldStickyHeader
? isIOS() || this.application.platform === Platform.Ios
? 'pt-safe-top'
: 'pt-4'
: '',
)}
>
<div className="mb-2 flex flex-wrap items-start justify-between gap-2 md:mb-0 md:flex-nowrap md:gap-0 xl:items-center">