Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

TextField not displaying placeholder value #98

Open
iyinolu opened this issue Mar 24, 2022 · 2 comments
Open

TextField not displaying placeholder value #98

iyinolu opened this issue Mar 24, 2022 · 2 comments

Comments

@iyinolu
Copy link

iyinolu commented Mar 24, 2022

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)
    );
  };
@joseito-terence
Copy link

Set initialText=""

@iyinolu
Copy link
Author

iyinolu commented May 26, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants