Skip to content

TagSpaces is an offline, open source, document manager with tagging support

disable spaces and other symbols in the tag names

Ilian Sapundshiev0cf5fd5fc985
diff --git a/app/components/dialogs/CreateTagsDialog.js b/app/components/dialogs/CreateTagsDialog.js
index 20d7e981e..38fd748ea 100644
--- a/app/components/dialogs/CreateTagsDialog.js
+++ b/app/components/dialogs/CreateTagsDialog.js
@@ -74,9 +74,8 @@ class CreateTagsDialog extends React.Component<Props, State> {
};
handleValidation() {
- // const regEx = '^[^#/\\ \[\]]{1,}$';
- const tagTitle = this.state.tagTitle.match(/[^,(?! )]+/g);
- if (tagTitle && tagTitle.length > 0) {
+ const tagCheck = RegExp(/^[^\#\/\\ \[\]]{1,}$/);
+ if (this.state.tagTitle && tagCheck.test(this.state.tagTitle)) {
this.setState({ inputError: false, disableConfirmButton: false });
} else {
this.setState({ inputError: true, disableConfirmButton: true });