Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

focus tag dialog on open

ammarahm-ed23314777dd61
diff --git a/apps/mobile/src/components/TagsDialog/index.js b/apps/mobile/src/components/TagsDialog/index.js
index f2ebc15ad..af14ba500 100644
--- a/apps/mobile/src/components/TagsDialog/index.js
+++ b/apps/mobile/src/components/TagsDialog/index.js
@@ -3,16 +3,17 @@ import {ScrollView, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {useTagStore} from '../../provider/stores';
-import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
+import {eSendEvent, eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import {db} from '../../utils/database';
-import {eCloseTagsDialog, eOpenTagsDialog} from '../../utils/Events';
+import {eCloseTagsDialog, eOpenTagsDialog, refreshNotesPage} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
import Input from '../Input';
import {PressableButton} from '../PressableButton';
import Paragraph from '../Typography/Paragraph';
import Heading from '../Typography/Heading';
+import { sleep } from '../../utils/TimeUtils';
const TagsDialog = () => {
const [state] = useTracked();
const colors = state.colors;
@@ -95,7 +96,6 @@ const TagsDialog = () => {
text: '',
});
try {
-
await db.notes.note(note.id).tag(tag);
useTagStore.getState().setTags();
setNote(db.notes.note(note.id).data);
@@ -120,6 +120,10 @@ const TagsDialog = () => {
<ActionSheetWrapper
centered={false}
fwdRef={actionSheetRef}
+ onOpen={async () => {
+ await sleep(300);
+ inputRef.current?.focus();
+ }}
onClose={async () => {
setQuery(null);
setVisible(false);
@@ -222,7 +226,6 @@ const TagItem = ({tag, note, setNote}) => {
useTagStore.getState().setTags();
setNote(db.notes.note(note.id).data);
} catch (e) {}
-
Navigation.setRoutesToUpdate([
Navigation.routeNames.NotesPage,
Navigation.routeNames.Favorites,