mirror of
https://github.com/standardnotes/mobile.git
synced 2026-02-05 05:21:26 -05:00
fix: slide to open note side menu
This commit is contained in:
@@ -82,7 +82,7 @@ export const AppStackComponent = (
|
||||
.addStateChangeObserver(event => {
|
||||
if (event === AppStateType.EditorClosed) {
|
||||
noteDrawerRef.current?.closeDrawer();
|
||||
if (!isInTabletMode) {
|
||||
if (!isInTabletMode && props.navigation.canGoBack()) {
|
||||
props.navigation.popToTop();
|
||||
}
|
||||
}
|
||||
@@ -147,6 +147,9 @@ export const AppStackComponent = (
|
||||
drawerWidth={getDefaultDrawerWidth(dimensions)}
|
||||
drawerPosition={'left'}
|
||||
drawerType="slide"
|
||||
drawerLockMode={
|
||||
hasEditor && !isInTabletMode ? 'locked-closed' : 'unlocked'
|
||||
}
|
||||
onDrawerStateChanged={handleDrawerStateChange}
|
||||
renderNavigationView={() =>
|
||||
!isLocked && <MainSideMenu drawerRef={drawerRef.current} />
|
||||
@@ -160,7 +163,7 @@ export const AppStackComponent = (
|
||||
onDrawerClose={() => setNoteDrawerOpen(false)}
|
||||
drawerPosition={'right'}
|
||||
drawerType="slide"
|
||||
drawerLockMode="locked-closed"
|
||||
drawerLockMode={hasEditor ? 'unlocked' : 'locked-closed'}
|
||||
renderNavigationView={() =>
|
||||
hasEditor && (
|
||||
<NoteSideMenu
|
||||
|
||||
@@ -164,10 +164,14 @@ export const Compose = React.memo(
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
if (mounted && editor && editor.isTemplateNote) {
|
||||
if (Platform.OS === 'ios') {
|
||||
editorViewRef.current?.focus();
|
||||
}
|
||||
if (
|
||||
mounted &&
|
||||
editor &&
|
||||
editor.isTemplateNote &&
|
||||
editor.note?.prefersPlainEditor &&
|
||||
Platform.OS === 'ios'
|
||||
) {
|
||||
editorViewRef.current?.focus();
|
||||
}
|
||||
return () => {
|
||||
mounted = false;
|
||||
@@ -181,6 +185,12 @@ export const Compose = React.memo(
|
||||
};
|
||||
}, [application, note?.uuid]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
application?.getAppState().closeActiveEditor();
|
||||
};
|
||||
}, [application]);
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
return dissmissKeybard;
|
||||
@@ -532,7 +542,11 @@ export const Compose = React.memo(
|
||||
<StyledTextView
|
||||
testID="noteContentField"
|
||||
ref={editorViewRef}
|
||||
autoFocus={Boolean(editor && editor.isTemplateNote)}
|
||||
autoFocus={Boolean(
|
||||
editor &&
|
||||
editor.isTemplateNote &&
|
||||
editor.note?.prefersPlainEditor
|
||||
)}
|
||||
value={note?.text}
|
||||
selectionColor={lighten(theme.stylekitInfoColor, 0.35)}
|
||||
handlesColor={theme.stylekitInfoColor}
|
||||
|
||||
Reference in New Issue
Block a user