react-native-tags icon indicating copy to clipboard operation
react-native-tags copied to clipboard

TextField not displaying placeholder value

Open iyinolu opened this issue 3 years ago • 2 comments

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)
    );
  };

iyinolu avatar Mar 24 '22 11:03 iyinolu

Set initialText=""

joseito-terence avatar May 26 '22 07:05 joseito-terence

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.

iyinolu avatar May 26 '22 14:05 iyinolu