react-tagsinput icon indicating copy to clipboard operation
react-tagsinput copied to clipboard

any chance for the tags to be editable?

Open paigeflourin opened this issue 6 years ago • 5 comments

i need this feature in my application

paigeflourin avatar Nov 29 '18 03:11 paigeflourin

I am facing the same issue.

vivekgusain3pg avatar Dec 19 '18 11:12 vivekgusain3pg

Already got asked for in #137 & #184

davidbucka avatar Mar 01 '19 20:03 davidbucka

I rewrite renderTag as follows, hope it helps

renderTag = (props) => {
	const { isTagFocus } = this.state
	const { tag, key, diasbled, onRemove, classNameRemove, getTagDisplayValue, ...other } = props
	return <span key={key} {...other} onBlur={() => { this.setState({ isTagFocus: false }) }}>
		{isTagFocus
			? <AutosizeInput
				onChange={this.hangdleTagChange}
				onFocus={(e) => {
					this.setState({
						tagEditIndex: this.state.inputBills.indexOf(e.target.value)
					})
				}}
				value={getTagDisplayValue(tag)}
				inputClassName={styles.tagEditInput}
			/>
			: <span onClick={() => { this.setState({ isTagFocus: true }) }}>
				{getTagDisplayValue(tag)}
			</span>
			}
			{!diasbled && <a className={classNameRemove} onClick={(e) => { onRemove(key) }}></a>}
	</span>
}

ChenCong6837 avatar May 27 '19 11:05 ChenCong6837

and how do you implement this?

FRickReich avatar Jul 08 '19 12:07 FRickReich

Simply add the renderTag prop like so <TagsInput renderTag={this.renderTag}/>

MosheSommers avatar Nov 13 '19 15:11 MosheSommers