Skip to content

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

remove trailing spaces or comma in tag.

ammarahm-ed443a3449df8c
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index c7822cf1f..c25f06f8c 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -82,10 +82,13 @@ export const ActionSheetComponent = ({
return;
}
let tag = tagToAdd;
-
+ tag = tag.trim();
if (tag.includes(' ')) {
tag = tag.replace(' ', '_');
}
+ if (tag.includes(',')) {
+ tag = tag.replace(',', '');
+ }
tagsInputRef.current?.setNativeProps({
text: '',
});
@@ -126,11 +129,13 @@ export const ActionSheetComponent = ({
tagsInputRef.current?.setNativeProps({
text: '',
});
+ return;
} else if (event.nativeEvent.key === ',') {
_onSubmit();
tagsInputRef.current?.setNativeProps({
text: '',
});
+ return;
}
};