From 470c071344f7e70da3405310da4cc6c468c120e3 Mon Sep 17 00:00:00 2001 From: Andy Klimczak Date: Mon, 29 Jan 2018 20:42:59 -0500 Subject: [PATCH] Remove leading # when creating tag - Remove leading # from tags that are created with leading # - Convenience method for users who tend to type them, but did not want a tag with double # - If a user wants a tag with a leading #, then can double it (ie: ##OfPeople) --- browser/main/Detail/TagSelect.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/main/Detail/TagSelect.js b/browser/main/Detail/TagSelect.js index 3e1efb86..191d9120 100644 --- a/browser/main/Detail/TagSelect.js +++ b/browser/main/Detail/TagSelect.js @@ -64,7 +64,8 @@ class TagSelect extends React.Component { submitTag () { AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_TAG') let { value } = this.props - const newTag = this.refs.newTag.value.trim().replace(/ +/g, '_') + let newTag = this.refs.newTag.value.trim().replace(/ +/g, '_') + newTag = newTag.charAt(0) === '#' ? newTag.substring(1) : newTag if (newTag.length <= 0) { this.setState({