react-native-tags
react-native-tags copied to clipboard
TextField not displaying placeholder value
showLastTag function prevent placeholder from displaying on the input field. This is because the initial value of text in state is set to a whitespace instead of an empty string.
showLastTag = () => {
this.setState(state =>
({
tags: state.tags.slice(0, -1),
text: state.tags.slice(-1)[0] || " "
}),
() =>
this.props.onChangeTags && this.props.onChangeTags(this.state.tags)
);
};
Set initialText=""
Yes, This works out. Although It works only when the field is first rendered. When all input values are cleared, the placeholder will not be visible.