mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 03:06:27 +00:00
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)
This commit is contained in:
@@ -64,7 +64,8 @@ class TagSelect extends React.Component {
|
|||||||
submitTag () {
|
submitTag () {
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_TAG')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_TAG')
|
||||||
let { value } = this.props
|
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) {
|
if (newTag.length <= 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
Reference in New Issue
Block a user