This repository was archived by the owner on Jun 13, 2023. It is now read-only.
This repository was archived by the owner on Jun 13, 2023. It is now read-only.
initial text for each tags #68
Open
Description
Hello @peterp ,
I was wondering if there is feature for initial text for each tags. Because, in props initialText just affect on the first tag. So it would be nice if the initial text also implement on every tags.
For example I want user to automatically input tags with the first character is '#'.
I try to modified your library, just basically add a new props initialEachText
and put it on
showLastTag = () => {
this.setState(state =>
({
tags: state.tags.slice(0, -1),
text: state.tags.slice(-1)[0] || this.state.initialEachText
}),
() =>
this.props.onChangeTags && this.props.onChangeTags(this.state.tags)
);
};
addTag = text => {
this.setState(state =>
({
tags: [...state.tags, text.trim()],
text: this.state.initialEachText
}),
() => this.props.onChangeTags && this.props.onChangeTags(this.state.tags)
);
};
Just changed the " " (space) to initialEachText that can be modified.
And I just set the props initialText={'#'}
and initialEachText={'#'}
.
This would be great if you considering to add this feature. Thank you 🤝
Metadata
Metadata
Assignees
Labels
No labels